diff --git a/swaggerci/datamigration/.gitattributes b/swaggerci/datamigration/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/datamigration/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/datamigration/.gitignore b/swaggerci/datamigration/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/datamigration/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/datamigration/Az.DataMigration.csproj b/swaggerci/datamigration/Az.DataMigration.csproj new file mode 100644 index 000000000000..3aed317d11e4 --- /dev/null +++ b/swaggerci/datamigration/Az.DataMigration.csproj @@ -0,0 +1,43 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.DataMigration.private + Microsoft.Azure.PowerShell.Cmdlets.DataMigration + true + false + ./bin + $(OutputPath) + Az.DataMigration.nuspec + true + + 1998 + true + + + + + false + TRACE;DEBUG;NETSTANDARD + + + + true + true + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + $(DefaultItemExcludes);resources/** + + + \ No newline at end of file diff --git a/swaggerci/datamigration/Az.DataMigration.format.ps1xml b/swaggerci/datamigration/Az.DataMigration.format.ps1xml new file mode 100644 index 000000000000..d8027cb92a8d --- /dev/null +++ b/swaggerci/datamigration/Az.DataMigration.format.ps1xml @@ -0,0 +1,14695 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.DataMigrationIdentity + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.DataMigrationIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FileName + + + GroupName + + + Id + + + Location + + + ManagedInstanceName + + + ProjectName + + + ResourceGroupName + + + ServiceName + + + SqlDbInstanceName + + + SqlMigrationServiceName + + + SqlVirtualMachineName + + + SubscriptionId + + + TargetDbName + + + TaskName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AuthenticationKeys + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AuthenticationKeys + + + + + + + + + + + + + + + AuthKey1 + + + AuthKey2 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSku + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSku + + + + + + + + + + + + ResourceType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuAutoGenerated + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuAutoGenerated + + + + + + + + + + + + + + + + + + + + + Family + + + Name + + + Size + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuCapacity + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuCapacity + + + + + + + + + + + + + + + + + + + + + Default + + + Maximum + + + Minimum + + + ScaleType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp + + + + + + + + + + + + + + + + + + + + + AppKey + + + ApplicationId + + + IgnoreAzurePermission + + + TenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlob + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlob + + + + + + + + + + + + + + + + + + AccountKey + + + BlobContainerName + + + StorageAccountResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfo + + + + + + + + + + + + + + + + + + FamilySequenceNumber + + + FileLocation + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupFinishedDate + + + BackupSetId + + + BackupStartDate + + + BackupType + + + DatabaseName + + + FirstLsn + + + IsBackupRestored + + + LastLsn + + + LastModifiedTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare + + + + + + + + + + + + SasUri + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskInput + + + + + + + + + + + + ServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties + + + + + + + + + + + + + + + CommandType + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo + + + + + + + + + + + + + + + + + + Password + + + Type + + + UserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToMongoDbTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToMongoDbTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskInput + + + + + + + + + + + + + + + + + + CheckPermissionsGroup + + + IsOfflineMigration + + + TargetPlatform + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceNonSqlTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceNonSqlTaskOutput + + + + + + + + + + + + + + + + + + Database + + + Id + + + SourceServerBrandVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskOutput + + + + + + + + + + + + + + + + + + Database + + + SourceServerBrandVersion + + + SourceServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskOutput + + + + + + + + + + + + + + + + + + + + + Database + + + Id + + + SourceServerBrandVersion + + + SourceServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CheckPermissionsGroup + + + CollectAgentJob + + + CollectDatabase + + + CollectLogin + + + CollectTdeCertificateInfo + + + EncryptedKeyForSecureField + + + ValidateSsisCatalogOnly + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputAgentJobLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputAgentJobLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + IsEnabled + + + JobCategory + + + JobOwner + + + LastExecutedOn + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + CompatibilityLevel + + + DatabaseState + + + Name + + + SizeMb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputLoginLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputLoginLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DefaultDatabase + + + IsEnabled + + + LoginType + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputTaskLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputTaskLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + AgentJob + + + Database + + + DatabaseTdeCertificateMapping + + + Login + + + SourceServerBrandVersion + + + SourceServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskProperties + + + + + + + + + + + + + + + + + + State + + + TaskType + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskInput + + + + + + + + + + + + IsOfflineMigration + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskOutput + + + + + + + + + + + + + + + + + + + + + Database + + + Id + + + ServerVersion + + + TargetServerBrandVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput + + + + + + + + + + + + + + + + + + + + + Database + + + Id + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput + + + + + + + + + + + + + + + + + + Database + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + + + + + + + + + + + + + + + Database + + + Schema + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskInput + + + + + + + + + + + + QueryObjectCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutput + + + + + + + + + + + + + + + + + + + + + Database + + + Id + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskProperties + + + + + + + + + + + + + + + + + + State + + + TaskType + + + CreatedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskOutput + + + + + + + + + + + + + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskInput + + + + + + + + + + + + + + + + + + CollectAgentJob + + + CollectLogin + + + ValidateSsisCatalogOnly + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskOutput + + + + + + + + + + + + + + + + + + + + + + + + AgentJob + + + Id + + + Login + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CopyDuration + + + CopyStart + + + CopyThroughput + + + DataRead + + + DataWritten + + + ParallelCopyType + + + RowsCopied + + + RowsRead + + + Status + + + TableName + + + UsedParallelCopy + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Database + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Database + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Collation + + + CompatibilityLevel + + + Fqdn + + + Id + + + InstallId + + + Name + + + ServerCoreCount + + + ServerDefaultBackupPath + + + ServerDefaultDataPath + + + ServerDefaultLogPath + + + ServerEdition + + + ServerId + + + ServerLevel + + + ServerName + + + ServerVersion + + + ServerVisibleOnlineCoreCount + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseBackupInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseBackupInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupFile + + + BackupFinishDate + + + BackupType + + + DatabaseName + + + FamilyCount + + + IsCompressed + + + IsDamaged + + + Position + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DatabaseName + + + FileType + + + Id + + + LogicalName + + + PhysicalFullName + + + RestoreFullName + + + SizeMb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInput + + + + + + + + + + + + + + + + + + + + + + + + FileType + + + Id + + + LogicalName + + + PhysicalFullName + + + RestoreFullName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseInfo + + + + + + + + + + + + SourceDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigration + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigration + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationListResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + Kind + + + MigrationOperationId + + + MigrationService + + + MigrationStatus + + + ProvisioningError + + + ProvisioningState + + + Scope + + + SourceDatabaseName + + + SourceServerName + + + StartedOn + + + TargetDatabaseCollation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlDb + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlDb + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + Kind + + + MigrationFailureErrorCode + + + MigrationFailureErrorMessage + + + MigrationOperationId + + + MigrationService + + + MigrationStatus + + + ProvisioningError + + + ProvisioningState + + + Scope + + + SourceDatabaseName + + + SourceServerName + + + SourceSqlConnectionAuthentication + + + SourceSqlConnectionDataSource + + + SourceSqlConnectionEncryptConnection + + + SourceSqlConnectionTrustServerCertificate + + + SourceSqlConnectionUserName + + + StartedOn + + + TargetDatabaseCollation + + + TableList + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlMi + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlMi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + Kind + + + MigrationFailureErrorCode + + + MigrationFailureErrorMessage + + + MigrationOperationId + + + MigrationService + + + MigrationStatus + + + ProvisioningError + + + ProvisioningState + + + Scope + + + SourceDatabaseName + + + SourceServerName + + + SourceSqlConnectionAuthentication + + + SourceSqlConnectionDataSource + + + SourceSqlConnectionEncryptConnection + + + SourceSqlConnectionTrustServerCertificate + + + SourceSqlConnectionUserName + + + StartedOn + + + TargetDatabaseCollation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlVM + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlVM + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + Kind + + + MigrationFailureErrorCode + + + MigrationFailureErrorMessage + + + MigrationOperationId + + + MigrationService + + + MigrationStatus + + + ProvisioningError + + + ProvisioningState + + + Scope + + + SourceDatabaseName + + + SourceServerName + + + SourceSqlConnectionAuthentication + + + SourceSqlConnectionDataSource + + + SourceSqlConnectionEncryptConnection + + + SourceSqlConnectionTrustServerCertificate + + + SourceSqlConnectionUserName + + + StartedOn + + + TargetDatabaseCollation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlDb + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlDb + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlMi + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlMi + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlVM + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlVM + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseObjectName + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseObjectName + + + + + + + + + + + + + + + + + + + + + DatabaseName + + + ObjectName + + + ObjectType + + + SchemaName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseSummaryResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseSummaryResult + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + ErrorPrefix + + + ItemsCompletedCount + + + ItemsCount + + + Name + + + ResultPrefix + + + StartedOn + + + State + + + StatusMessage + + + SizeMb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTable + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTable + + + + + + + + + + + + + + + HasRow + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjects + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjects + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataItemMigrationSummaryResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataItemMigrationSummaryResult + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + ErrorPrefix + + + ItemsCompletedCount + + + ItemsCount + + + Name + + + ResultPrefix + + + StartedOn + + + State + + + StatusMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationError + + + + + + + + + + + + + + + Message + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationProjectMetadata + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationProjectMetadata + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceServerName + + + SourceServerPort + + + SourceUsername + + + TargetDbName + + + TargetServerName + + + TargetUsername + + + TargetUsingWinAuth + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + Etag + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceList + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + AutoStopDelay + + + DeleteResourcesOnStop + + + ProvisioningState + + + PublicKey + + + VirtualNicId + + + VirtualSubnetId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceStatusResponse + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceStatusResponse + + + + + + + + + + + + + + + + + + + + + AgentVersion + + + Status + + + SupportedTaskType + + + VMSize + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DeleteNode + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DeleteNode + + + + + + + + + + + + + + + IntegrationRuntimeName + + + NodeName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfo + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics + + + + + + + + + + + + + + + + + + + + + + + + CpuTimeMS + + + ElapsedTimeMS + + + ExecutionCount + + + HasError + + + SqlError + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileList + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare + + + + + + + + + + + + + + + + + + Password + + + Path + + + UserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfo + + + + + + + + + + + + Uri + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfoHeaders + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfoHeaders + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetProjectDetailsNonSqlTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetProjectDetailsNonSqlTaskInput + + + + + + + + + + + + + + + ProjectLocation + + + ProjectName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskOutput + + + + + + + + + + + + Base64EncodedCertificate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskInput + + + + + + + + + + + + SelectedDatabase + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskOutput + + + + + + + + + + + + + + + DatabasesToTable + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskInput + + + + + + + + + + + + SelectedSchema + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskOutput + + + + + + + + + + + + SchemaName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskInput + + + + + + + + + + + + SelectedDatabase + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskOutput + + + + + + + + + + + + DatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskInput + + + + + + + + + + + + + + + SelectedSourceDatabase + + + SelectedTargetDatabase + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskOutput + + + + + + + + + + + + + + + + + + DatabasesToSourceTable + + + DatabasesToTargetTable + + + TableValidationError + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskInput + + + + + + + + + + + + + + + EncryptedKeyForSecureField + + + SelectedDatabase + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskOutput + + + + + + + + + + + + + + + DatabasesToTable + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskProperties + + + + + + + + + + + + + + + + + + State + + + TaskType + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskInput + + + + + + + + + + + + DriverPackageName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IntegrationRuntimeMonitoringData + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IntegrationRuntimeMonitoringData + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandInput + + + + + + + + + + + + SourceDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandProperties + + + + + + + + + + + + + + + CommandType + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMongoDbTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMongoDbTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput + + + + + + + + + + + + + + + Name + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInput + + + + + + + + + + + + + + + + + + EncryptedKeyForSecureField + + + MakeSourceServerReadOnly + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DatabaseName + + + EndedOn + + + ErrorCount + + + ErrorPrefix + + + LastStorageUpdate + + + Message + + + NumberOfObject + + + NumberOfObjectsCompleted + + + ObjectSummary + + + ResultPrefix + + + Stage + + + StartedOn + + + State + + + StatusMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + Database + + + DatabaseSummary + + + DurationInSecond + + + EndedOn + + + LastStorageUpdate + + + Message + + + SourceServerBrandVersion + + + SourceServerVersion + + + StartedOn + + + Status + + + StatusMessage + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + ErrorPrefix + + + ItemsCompletedCount + + + ItemsCount + + + LastStorageUpdate + + + ObjectName + + + ResultPrefix + + + StartedOn + + + State + + + StatusMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskProperties + + + + + + + + + + + + + + + + + + + + + State + + + TaskType + + + IsCloneable + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInput + + + + + + + + + + + + + + + Name + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + ErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + AppliedChange + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DatabaseName + + + EndedOn + + + FullLoadCompletedTable + + + FullLoadErroredTable + + + FullLoadLoadingTable + + + FullLoadQueuedTable + + + IncomingChange + + + InitializationCompleted + + + Latency + + + MigrationState + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + SourceServer + + + SourceServerVersion + + + StartedOn + + + TargetServer + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DataErrorsCounter + + + DatabaseName + + + FullLoadEndedOn + + + FullLoadEstFinishTime + + + FullLoadStartedOn + + + FullLoadTotalRow + + + LastModifiedTime + + + State + + + TableName + + + TotalChangesApplied + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput + + + + + + + + + + + + + + + + + + + + + CaseManipulation + + + Name + + + SchemaName + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + ErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + AppliedChange + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DatabaseName + + + EndedOn + + + FullLoadCompletedTable + + + FullLoadErroredTable + + + FullLoadLoadingTable + + + FullLoadQueuedTable + + + IncomingChange + + + InitializationCompleted + + + Latency + + + MigrationState + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + SourceServer + + + SourceServerVersion + + + StartedOn + + + TargetServer + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DataErrorsCounter + + + DatabaseName + + + FullLoadEndedOn + + + FullLoadEstFinishTime + + + FullLoadStartedOn + + + FullLoadTotalRow + + + LastModifiedTime + + + State + + + TableName + + + TotalChangesApplied + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput + + + + + + + + + + + + + + + + + + Id + + + Name + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + + + + + + + + + + + + + + + EncryptedKeyForSecureField + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + ErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + AppliedChange + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DatabaseName + + + EndedOn + + + FullLoadCompletedTable + + + FullLoadErroredTable + + + FullLoadLoadingTable + + + FullLoadQueuedTable + + + IncomingChange + + + InitializationCompleted + + + Latency + + + MigrationState + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DatabaseCount + + + EndedOn + + + SourceServer + + + SourceServerType + + + SourceServerVersion + + + StartedOn + + + State + + + TargetServer + + + TargetServerType + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DataErrorsCounter + + + DatabaseName + + + FullLoadEndedOn + + + FullLoadEstFinishTime + + + FullLoadStartedOn + + + FullLoadTotalRow + + + LastModifiedTime + + + State + + + TableName + + + TotalChangesApplied + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + + + + + + + + + + + + + + + + + + + + + + + + State + + + TaskType + + + CreatedOn + + + IsCloneable + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbDatabaseInput + + + + + + + + + + + + + + + + + + Id + + + Name + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceConnectionInfoAdditionalSetting + + + SourceConnectionInfoAuthentication + + + SourceConnectionInfoDataSource + + + SourceConnectionInfoEncryptConnection + + + SourceConnectionInfoPassword + + + SourceConnectionInfoPlatform + + + SourceConnectionInfoPort + + + SourceConnectionInfoResourceId + + + SourceConnectionInfoServerBrandVersion + + + SourceConnectionInfoServerName + + + SourceConnectionInfoServerVersion + + + SourceConnectionInfoTrustServerCertificate + + + SourceConnectionInfoType + + + SourceConnectionInfoUserName + + + TargetConnectionInfoAdditionalSetting + + + TargetConnectionInfoAuthentication + + + TargetConnectionInfoDataSource + + + TargetConnectionInfoEncryptConnection + + + TargetConnectionInfoPassword + + + TargetConnectionInfoPlatform + + + TargetConnectionInfoPort + + + TargetConnectionInfoResourceId + + + TargetConnectionInfoServerBrandVersion + + + TargetConnectionInfoServerName + + + TargetConnectionInfoServerVersion + + + TargetConnectionInfoTrustServerCertificate + + + TargetConnectionInfoType + + + TargetConnectionInfoUserName + + + EncryptedKeyForSecureField + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DatabaseErrorResultPrefix + + + DatabaseName + + + EndedOn + + + FileId + + + NumberOfFailedOperation + + + NumberOfSuccessfulOperation + + + SchemaErrorResultPrefix + + + Stage + + + StartedOn + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputError + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + CommandText + + + ErrorText + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + SourceServerBrandVersion + + + SourceServerVersion + + + StartedOn + + + State + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskProperties + + + + + + + + + + + + + + + + + + + + + + + + State + + + TaskType + + + CreatedOn + + + IsCloneable + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerDatabaseInput + + + + + + + + + + + + + + + + + + BackupAndRestoreFolder + + + Name + + + RestoreDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInput + + + + + + + + + + + + + + + + + + + + + Id + + + MakeSourceDbReadOnly + + + Name + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTableMap + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTableMap + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInput + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SchemaName + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTableMap + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTableMap + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceConnectionInfoAdditionalSetting + + + SourceConnectionInfoAuthentication + + + SourceConnectionInfoDataSource + + + SourceConnectionInfoEncryptConnection + + + SourceConnectionInfoPassword + + + SourceConnectionInfoPlatform + + + SourceConnectionInfoPort + + + SourceConnectionInfoResourceId + + + SourceConnectionInfoServerBrandVersion + + + SourceConnectionInfoServerName + + + SourceConnectionInfoServerVersion + + + SourceConnectionInfoTrustServerCertificate + + + SourceConnectionInfoType + + + SourceConnectionInfoUserName + + + TargetConnectionInfoAdditionalSetting + + + TargetConnectionInfoAuthentication + + + TargetConnectionInfoDataSource + + + TargetConnectionInfoEncryptConnection + + + TargetConnectionInfoPassword + + + TargetConnectionInfoPlatform + + + TargetConnectionInfoPort + + + TargetConnectionInfoResourceId + + + TargetConnectionInfoServerBrandVersion + + + TargetConnectionInfoServerName + + + TargetConnectionInfoServerVersion + + + TargetConnectionInfoTrustServerCertificate + + + TargetConnectionInfoType + + + TargetConnectionInfoUserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + ErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + AppliedChange + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DatabaseName + + + EndedOn + + + FullLoadCompletedTable + + + FullLoadErroredTable + + + FullLoadLoadingTable + + + FullLoadQueuedTable + + + IncomingChange + + + InitializationCompleted + + + Latency + + + MigrationState + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DatabaseCount + + + EndedOn + + + SourceServer + + + SourceServerVersion + + + StartedOn + + + TargetServer + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputTableLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputTableLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + CdcDeleteCounter + + + CdcInsertCounter + + + CdcUpdateCounter + + + DataErrorsCounter + + + DatabaseName + + + FullLoadEndedOn + + + FullLoadEstFinishTime + + + FullLoadStartedOn + + + FullLoadTotalRow + + + LastModifiedTime + + + State + + + TableName + + + TotalChangesApplied + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceConnectionInfoAdditionalSetting + + + SourceConnectionInfoAuthentication + + + SourceConnectionInfoDataSource + + + SourceConnectionInfoEncryptConnection + + + SourceConnectionInfoPassword + + + SourceConnectionInfoPlatform + + + SourceConnectionInfoPort + + + SourceConnectionInfoResourceId + + + SourceConnectionInfoServerBrandVersion + + + SourceConnectionInfoServerName + + + SourceConnectionInfoServerVersion + + + SourceConnectionInfoTrustServerCertificate + + + SourceConnectionInfoType + + + SourceConnectionInfoUserName + + + TargetConnectionInfoAdditionalSetting + + + TargetConnectionInfoAuthentication + + + TargetConnectionInfoDataSource + + + TargetConnectionInfoEncryptConnection + + + TargetConnectionInfoPassword + + + TargetConnectionInfoPlatform + + + TargetConnectionInfoPort + + + TargetConnectionInfoResourceId + + + TargetConnectionInfoServerBrandVersion + + + TargetConnectionInfoServerName + + + TargetConnectionInfoServerVersion + + + TargetConnectionInfoTrustServerCertificate + + + TargetConnectionInfoType + + + TargetConnectionInfoUserName + + + EncryptedKeyForSecureField + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DatabaseName + + + EndedOn + + + ErrorCount + + + ErrorPrefix + + + Message + + + NumberOfObject + + + NumberOfObjectsCompleted + + + ObjectSummary + + + ResultPrefix + + + Stage + + + StartedOn + + + State + + + StatusMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DataIntegrityValidationResultValidationErrorsSeverity + + + DataIntegrityValidationResultValidationErrorsText + + + EndedOn + + + Id + + + MigrationId + + + QueryAnalysisValidationResultValidationErrorsSeverity + + + QueryAnalysisValidationResultValidationErrorsText + + + QueryResultQueryText + + + QueryResultStatementsInBatch + + + ResultType + + + SchemaDifferenceObjectName + + + SchemaDifferenceObjectType + + + SchemaDifferenceUpdateAction + + + SchemaValidationResultValidationErrorsSeverity + + + SchemaValidationResultValidationErrorsText + + + SourceDatabaseName + + + SourceResultCpuTimeMS + + + SourceResultElapsedTimeMS + + + SourceResultExecutionCount + + + SourceResultHasError + + + SourceResultSqlError + + + StartedOn + + + Status + + + TargetDatabaseName + + + TargetResultCpuTimeMS + + + TargetResultElapsedTimeMS + + + TargetResultExecutionCount + + + TargetResultHasError + + + TargetResultSqlError + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + Database + + + DatabaseSummary + + + DurationInSecond + + + EndedOn + + + Message + + + SourceServerBrandVersion + + + SourceServerVersion + + + StartedOn + + + Status + + + StatusMessage + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputTableLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputTableLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + ErrorPrefix + + + ItemsCompletedCount + + + ItemsCount + + + ObjectName + + + ResultPrefix + + + StartedOn + + + State + + + StatusMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputValidationResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputValidationResult + + + + + + + + + + + + + + + + + + + + + Id + + + MigrationId + + + ResultType + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskProperties + + + + + + + + + + + + + + + + + + + + + + + + State + + + TaskType + + + CreatedOn + + + IsCloneable + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInput + + + + + + + + + + + + + + + + + + + + + BackupFilePath + + + Id + + + Name + + + RestoreDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureAppApplicationId + + + AzureAppIgnoreAzurePermission + + + AzureAppKey + + + AzureAppTenantId + + + BackupFileSharePassword + + + BackupFileSharePath + + + BackupFileShareUserName + + + SourceConnectionInfoAdditionalSetting + + + SourceConnectionInfoAuthentication + + + SourceConnectionInfoDataSource + + + SourceConnectionInfoEncryptConnection + + + SourceConnectionInfoPassword + + + SourceConnectionInfoPlatform + + + SourceConnectionInfoPort + + + SourceConnectionInfoResourceId + + + SourceConnectionInfoServerBrandVersion + + + SourceConnectionInfoServerName + + + SourceConnectionInfoServerVersion + + + SourceConnectionInfoTrustServerCertificate + + + SourceConnectionInfoType + + + SourceConnectionInfoUserName + + + StorageResourceId + + + TargetConnectionInfoManagedInstanceResourceId + + + TargetConnectionInfoPassword + + + TargetConnectionInfoType + + + TargetConnectionInfoUserName + + + NumberOfParallelDatabaseMigration + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + ContainerName + + + EndedOn + + + ErrorPrefix + + + IsFullBackupRestored + + + MigrationState + + + SourceDatabaseName + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DatabaseCount + + + DatabaseErrorCount + + + EndedOn + + + SourceServerBrandVersion + + + SourceServerName + + + SourceServerVersion + + + StartedOn + + + State + + + TargetServerBrandVersion + + + TargetServerName + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskProperties + + + + + + + + + + + + + + + + + + State + + + TaskType + + + CreatedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceConnectionInfoAdditionalSetting + + + SourceConnectionInfoAuthentication + + + SourceConnectionInfoDataSource + + + SourceConnectionInfoEncryptConnection + + + SourceConnectionInfoPassword + + + SourceConnectionInfoPlatform + + + SourceConnectionInfoPort + + + SourceConnectionInfoResourceId + + + SourceConnectionInfoServerBrandVersion + + + SourceConnectionInfoServerName + + + SourceConnectionInfoServerVersion + + + SourceConnectionInfoTrustServerCertificate + + + SourceConnectionInfoType + + + SourceConnectionInfoUserName + + + TargetConnectionInfoAdditionalSetting + + + TargetConnectionInfoAuthentication + + + TargetConnectionInfoDataSource + + + TargetConnectionInfoEncryptConnection + + + TargetConnectionInfoPassword + + + TargetConnectionInfoPlatform + + + TargetConnectionInfoPort + + + TargetConnectionInfoResourceId + + + TargetConnectionInfoServerBrandVersion + + + TargetConnectionInfoServerName + + + TargetConnectionInfoServerVersion + + + TargetConnectionInfoTrustServerCertificate + + + TargetConnectionInfoType + + + TargetConnectionInfoUserName + + + AadDomainName + + + BackupMode + + + EncryptedKeyForSecureField + + + SelectedAgentJob + + + SelectedLogin + + + StartedOn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputAgentJobLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputAgentJobLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + IsEnabled + + + Message + + + Name + + + StartedOn + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputDatabaseLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputDatabaseLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + DatabaseName + + + EndedOn + + + Message + + + SizeMb + + + Stage + + + StartedOn + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputError + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputLoginLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputLoginLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + LoginName + + + Message + + + Stage + + + StartedOn + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + AgentJob + + + Database + + + EndedOn + + + Login + + + Message + + + ServerRoleResult + + + SourceServerBrandVersion + + + SourceServerVersion + + + StartedOn + + + State + + + Status + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + State + + + TaskType + + + CreatedOn + + + IsCloneable + + + ParentTaskId + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceConnectionInfoAdditionalSetting + + + SourceConnectionInfoAuthentication + + + SourceConnectionInfoDataSource + + + SourceConnectionInfoEncryptConnection + + + SourceConnectionInfoPassword + + + SourceConnectionInfoPlatform + + + SourceConnectionInfoPort + + + SourceConnectionInfoResourceId + + + SourceConnectionInfoServerBrandVersion + + + SourceConnectionInfoServerName + + + SourceConnectionInfoServerVersion + + + SourceConnectionInfoTrustServerCertificate + + + SourceConnectionInfoType + + + SourceConnectionInfoUserName + + + TargetConnectionInfoAdditionalSetting + + + TargetConnectionInfoAuthentication + + + TargetConnectionInfoDataSource + + + TargetConnectionInfoEncryptConnection + + + TargetConnectionInfoPassword + + + TargetConnectionInfoPlatform + + + TargetConnectionInfoPort + + + TargetConnectionInfoResourceId + + + TargetConnectionInfoServerBrandVersion + + + TargetConnectionInfoServerName + + + TargetConnectionInfoServerVersion + + + TargetConnectionInfoTrustServerCertificate + + + TargetConnectionInfoType + + + TargetConnectionInfoUserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutput + + + + + + + + + + + + + + + Id + + + ResultType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutputMigrationLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutputMigrationLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + Message + + + SourceServerBrandVersion + + + SourceServerVersion + + + Stage + + + StartedOn + + + Status + + + TargetServerBrandVersion + + + TargetServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutputProjectLevel + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutputProjectLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + ResultType + + + EndedOn + + + FolderName + + + Message + + + ProjectName + + + Stage + + + StartedOn + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandInput + + + + + + + + + + + + + + + CommitTimeStamp + + + DatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandOutput + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandProperties + + + + + + + + + + + + + + + + + + CommandType + + + State + + + CommandId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo + + + + + + + + + + + + + + + IsEligibleForMigration + + + ValidationMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput + + + + + + + + + + + + MigrationOperationId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult + + + + + + + + + + + + + + + Id + + + ReportUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BlobContainerName + + + CompleteRestoreErrorMessage + + + CurrentRestoringFilename + + + FileUploadBlockingError + + + InvalidFile + + + IsFullBackupRestored + + + LastRestoredFilename + + + MigrationState + + + PendingLogBackupsCount + + + RestoreBlockingReason + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationTableMetadata + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationTableMetadata + + + + + + + + + + + + + + + SourceTableName + + + TargetTableName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationDatabaseLevelResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationDatabaseLevelResult + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + MigrationId + + + SourceDatabaseName + + + StartedOn + + + Status + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationDatabaseSummaryResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationDatabaseSummaryResult + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndedOn + + + Id + + + MigrationId + + + SourceDatabaseName + + + StartedOn + + + Status + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions + + + + + + + + + + + + + + + + + + EnableDataIntegrityValidation + + + EnableQueryAnalysisValidation + + + EnableSchemaValidation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResult + + + + + + + + + + + + + + + MigrationId + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo + + + + + + + + + + + + + + + + + + + + + Password + + + Type + + + UserName + + + ManagedInstanceResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCancelCommand + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCancelCommand + + + + + + + + + + + + + + + CommandType + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbClusterInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbClusterInfo + + + + + + + + + + + + + + + + + + SupportsSharding + + + Type + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AverageDocumentSize + + + DataSize + + + DocumentCount + + + Name + + + QualifiedName + + + DatabaseName + + + IsCapped + + + IsSystemCollection + + + IsView + + + SupportsSharding + + + ViewOf + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionProgress + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionProgress + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BytesCopied + + + DocumentsCopied + + + ElapsedTime + + + EventsPending + + + EventsReplayed + + + LastEventTime + + + LastReplayTime + + + Name + + + QualifiedName + + + ResultType + + + State + + + TotalByte + + + TotalDocument + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionSettings + + + + + + + + + + + + + + + CanDelete + + + TargetRUs + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput + + + + + + + + + + + + ObjectName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Password + + + Type + + + UserName + + + AdditionalSetting + + + Authentication + + + ConnectionString + + + DataSource + + + EncryptConnection + + + EnforceSsl + + + Port + + + ServerBrandVersion + + + ServerName + + + ServerVersion + + + TrustServerCertificate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + AverageDocumentSize + + + DataSize + + + DocumentCount + + + Name + + + QualifiedName + + + SupportsSharding + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgress + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgress + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BytesCopied + + + DocumentsCopied + + + ElapsedTime + + + EventsPending + + + EventsReplayed + + + LastEventTime + + + LastReplayTime + + + Name + + + QualifiedName + + + ResultType + + + State + + + TotalByte + + + TotalDocument + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettings + + + + + + + + + + + + TargetRUs + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbError + + + + + + + + + + + + + + + + + + + + + Code + + + Count + + + Message + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommand + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommand + + + + + + + + + + + + + + + CommandType + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommandInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommandInput + + + + + + + + + + + + + + + ObjectName + + + Immediate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgress + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgress + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BytesCopied + + + DocumentsCopied + + + ElapsedTime + + + EventsPending + + + EventsReplayed + + + LastEventTime + + + LastReplayTime + + + Name + + + QualifiedName + + + ResultType + + + State + + + TotalByte + + + TotalDocument + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettings + + + + + + + + + + + + + + + BoostRUs + + + Replication + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbObjectInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbObjectInfo + + + + + + + + + + + + + + + + + + + + + + + + AverageDocumentSize + + + DataSize + + + DocumentCount + + + Name + + + QualifiedName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BytesCopied + + + DocumentsCopied + + + ElapsedTime + + + EventsPending + + + EventsReplayed + + + LastEventTime + + + LastReplayTime + + + Name + + + QualifiedName + + + ResultType + + + State + + + TotalByte + + + TotalDocument + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbRestartCommand + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbRestartCommand + + + + + + + + + + + + + + + CommandType + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyField + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyField + + + + + + + + + + + + + + + Name + + + Order + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyInfo + + + + + + + + + + + + IsUnique + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeySetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeySetting + + + + + + + + + + + + IsUnique + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbThrottlingSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbThrottlingSettings + + + + + + + + + + + + + + + + + + MaxParallelism + + + MinFreeCpu + + + MinFreeMemoryMb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Password + + + Type + + + UserName + + + AdditionalSetting + + + Authentication + + + DataSource + + + EncryptConnection + + + Port + + + ServerName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityRequest + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityRequest + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityResponse + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityResponse + + + + + + + + + + + + + + + + + + Message + + + NameAvailable + + + Reason + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringData + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringData + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AvailableMemoryInMb + + + ConcurrentJobsLimit + + + ConcurrentJobsRunning + + + CpuUtilization + + + MaxConcurrentJob + + + NodeName + + + ReceivedByte + + + SentByte + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlDataMigrationTable + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlDataMigrationTable + + + + + + + + + + + + SourceName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlDataMigrationTableResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlDataMigrationTableResult + + + + + + + + + + + + + + + + + + + + + + + + + + + ElapsedTimeInMilisecond + + + ResultCode + + + SourceName + + + SourceRowCount + + + TargetName + + + TargetRowCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlMigrationTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlMigrationTaskInput + + + + + + + + + + + + + + + + + + ProjectLocation + + + ProjectName + + + TargetDatabaseName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlMigrationTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlMigrationTaskOutput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DataMigrationTableResult + + + EndedOn + + + Id + + + ProgressMessage + + + SourceServerName + + + StartedOn + + + Status + + + TargetServerName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration + + + + + + + + + + + + + + + LastBackupName + + + Offline + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationListResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinition + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinition + + + + + + + + + + + + + + + + + + IsDataAction + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDisplayDefinition + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDisplayDefinition + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Password + + + Type + + + UserName + + + Authentication + + + DataSource + + + Port + + + ServerName + + + ServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleOciDriverInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleOciDriverInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + ArchiveChecksum + + + AssemblyVersion + + + DriverName + + + DriverSize + + + OracleChecksum + + + SupportedOracleVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OrphanedUserInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OrphanedUserInfo + + + + + + + + + + + + + + + DatabaseName + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Password + + + Type + + + UserName + + + AdditionalSetting + + + Authentication + + + DataSource + + + DatabaseName + + + EncryptConnection + + + Port + + + ServerBrandVersion + + + ServerName + + + ServerVersion + + + TrustServerCertificate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFileProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFileProperties + + + + + + + + + + + + + + + + + + + + + + + + Extension + + + FilePath + + + LastModified + + + MediaType + + + Size + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectList + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectProperties + + + + + + + + + + + + + + + + + + + + + CreationTime + + + ProvisioningState + + + SourcePlatform + + + TargetPlatform + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientData + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientData + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResult + + + + + + + + + + + + + + + QueryText + + + StatementsInBatch + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Quota + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Quota + + + + + + + + + + + + + + + + + + + + + CurrentValue + + + Id + + + Limit + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaList + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaName + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaName + + + + + + + + + + + + + + + LocalizedValue + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.RegenAuthKeys + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.RegenAuthKeys + + + + + + + + + + + + + + + + + + AuthKey1 + + + AuthKey2 + + + KeyName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException + + + + + + + + + + + + + + + + + + + + + + + + + + + ActionableMessage + + + FilePath + + + HResult + + + LineNumber + + + Message + + + StackTrace + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Resource + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Resource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSku + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ApiVersion + + + Family + + + Kind + + + Location + + + Name + + + ResourceType + + + Size + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapabilities + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapabilities + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapacity + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapacity + + + + + + + + + + + + + + + + + + + + + Default + + + Maximum + + + Minimum + + + ScaleType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCosts + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCosts + + + + + + + + + + + + + + + + + + ExtendedUnit + + + MeterId + + + Quantity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuRestrictions + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuRestrictions + + + + + + + + + + + + + + + + + + ReasonCode + + + Type + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkusResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkusResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCount + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCount + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCount + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCount + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultType + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultType + + + + + + + + + + + + + + + + + + ObjectName + + + ObjectType + + + UpdateAction + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaMigrationSetting + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaMigrationSetting + + + + + + + + + + + + + + + + + + FileId + + + FileName + + + SchemaOption + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SelectedCertificateInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SelectedCertificateInput + + + + + + + + + + + + + + + CertificateName + + + Password + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServerProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServerProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + ServerDatabaseCount + + + ServerEdition + + + ServerName + + + ServerOperatingSystemVersion + + + ServerPlatform + + + ServerVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperation + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperation + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationDisplay + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationList + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSku + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSku + + + + + + + + + + + + + + + + + + + + + + + + Capacity + + + Family + + + Name + + + Size + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSkuList + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSkuList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocation + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocation + + + + + + + + + + + + FileStorageType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CopyDuration + + + CopyThroughput + + + DataRead + + + DataWritten + + + FamilySequenceNumber + + + FileName + + + Status + + + TotalSize + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupFinishDate + + + BackupSetId + + + BackupStartDate + + + BackupType + + + FamilyCount + + + FirstLsn + + + HasBackupChecksum + + + IgnoreReason + + + IsBackupRestored + + + LastLsn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Password + + + Type + + + UserName + + + AdditionalSetting + + + Authentication + + + DataSource + + + EncryptConnection + + + Platform + + + Port + + + ResourceId + + + ServerBrandVersion + + + ServerName + + + ServerVersion + + + TrustServerCertificate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation + + + + + + + + + + + + + + + + + + + + + + + + Authentication + + + DataSource + + + EncryptConnection + + + TrustServerCertificate + + + UserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetails + + + + + + + + + + + + + + + MigrationState + + + SqlDataCopyError + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfiguration + + + + + + + + + + + + Offline + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShare + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShare + + + + + + + + + + + + + + + Path + + + Username + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationListResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationService + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationService + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceProperties + + + + + + + + + + + + + + + IntegrationRuntimeState + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdateTags + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdateTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput + + + + + + + + + + + + StorageResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SsisMigrationInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SsisMigrationInfo + + + + + + + + + + + + + + + + + + EnvironmentOverwriteOption + + + ProjectOverwriteOption + + + SsisStoreType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.StartMigrationScenarioServerRoleResult + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.StartMigrationScenarioServerRoleResult + + + + + + + + + + + + + + + Name + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEvent + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEvent + + + + + + + + + + + + + + + + + + EventText + + + EventTypeString + + + TimestampString + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocation + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocation + + + + + + + + + + + + + + + AccountKey + + + StorageAccountResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TaskList + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TaskList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskOutput + + + + + + + + + + + + DriverPackageName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskInput + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureAppApplicationId + + + AzureAppIgnoreAzurePermission + + + AzureAppKey + + + AzureAppTenantId + + + BackupFileSharePassword + + + BackupFileSharePath + + + BackupFileShareUserName + + + SourceConnectionInfoAdditionalSetting + + + SourceConnectionInfoAuthentication + + + SourceConnectionInfoDataSource + + + SourceConnectionInfoEncryptConnection + + + SourceConnectionInfoPassword + + + SourceConnectionInfoPlatform + + + SourceConnectionInfoPort + + + SourceConnectionInfoResourceId + + + SourceConnectionInfoServerBrandVersion + + + SourceConnectionInfoServerName + + + SourceConnectionInfoServerVersion + + + SourceConnectionInfoTrustServerCertificate + + + SourceConnectionInfoType + + + SourceConnectionInfoUserName + + + StorageResourceId + + + TargetConnectionInfoManagedInstanceResourceId + + + TargetConnectionInfoPassword + + + TargetConnectionInfoType + + + TargetConnectionInfoUserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskOutput + + + + + + + + + + + + + + + Id + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskInput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskInput + + + + + + + + + + + + + + + BackupMode + + + SelectedLogin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskOutput + + + + + + + + + + + + + + + Id + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMongoDbTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMongoDbTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + + + + + + + + + + + + + + + State + + + TaskType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskOutput + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskOutput + + + + + + + + + + + + + + + Id + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError + + + + + + + + + + + + + + + Severity + + + Text + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.WaitStatistics + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.WaitStatistics + + + + + + + + + + + + + + + + + + WaitCount + + + WaitTimeMS + + + WaitType + + + + + + + + \ No newline at end of file diff --git a/swaggerci/datamigration/Az.DataMigration.nuspec b/swaggerci/datamigration/Az.DataMigration.nuspec new file mode 100644 index 000000000000..ac7603b05392 --- /dev/null +++ b/swaggerci/datamigration/Az.DataMigration.nuspec @@ -0,0 +1,32 @@ + + + + Az.DataMigration + 0.1.0 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell: $(service-name) cmdlets + + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM PSModule $(service-name) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/datamigration/Az.DataMigration.psd1 b/swaggerci/datamigration/Az.DataMigration.psd1 new file mode 100644 index 000000000000..5b2aba09789b --- /dev/null +++ b/swaggerci/datamigration/Az.DataMigration.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = 'b49682f6-3563-4e8c-b685-8e8facd121e7' + RootModule = './Az.DataMigration.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: DataMigration cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.DataMigration.private.dll' + FormatsToProcess = './Az.DataMigration.format.ps1xml' + FunctionsToExport = 'Get-AzDataMigrationDatabaseMigrationsSqlDb', 'Get-AzDataMigrationDatabaseMigrationsSqlMi', 'Get-AzDataMigrationDatabaseMigrationsSqlVM', 'Get-AzDataMigrationFile', 'Get-AzDataMigrationProject', 'Get-AzDataMigrationResourceSku', 'Get-AzDataMigrationService', 'Get-AzDataMigrationServiceSku', 'Get-AzDataMigrationServiceTask', 'Get-AzDataMigrationSqlMigrationService', 'Get-AzDataMigrationSqlMigrationServiceAuthKey', 'Get-AzDataMigrationSqlMigrationServiceMigration', 'Get-AzDataMigrationSqlMigrationServiceMonitoringData', 'Get-AzDataMigrationTask', 'Get-AzDataMigrationUsage', 'Invoke-AzDataMigrationCommandTask', 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi', 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM', 'New-AzDataMigrationDatabaseMigrationSqlDb', 'New-AzDataMigrationDatabaseMigrationSqlMi', 'New-AzDataMigrationDatabaseMigrationSqlVM', 'New-AzDataMigrationFile', 'New-AzDataMigrationProject', 'New-AzDataMigrationService', 'New-AzDataMigrationServiceTask', 'New-AzDataMigrationSqlMigrationService', 'New-AzDataMigrationSqlMigrationServiceAuthKey', 'New-AzDataMigrationTask', 'Read-AzDataMigrationFile', 'Read-AzDataMigrationFileWrite', 'Remove-AzDataMigrationDatabaseMigrationsSqlDb', 'Remove-AzDataMigrationFile', 'Remove-AzDataMigrationProject', 'Remove-AzDataMigrationService', 'Remove-AzDataMigrationServiceTask', 'Remove-AzDataMigrationSqlMigrationService', 'Remove-AzDataMigrationSqlMigrationServiceNode', 'Remove-AzDataMigrationTask', 'Start-AzDataMigrationService', 'Stop-AzDataMigrationDatabaseMigrationsSqlDb', 'Stop-AzDataMigrationDatabaseMigrationsSqlMi', 'Stop-AzDataMigrationDatabaseMigrationsSqlVM', 'Stop-AzDataMigrationService', 'Stop-AzDataMigrationServiceTask', 'Stop-AzDataMigrationTask', 'Test-AzDataMigrationServiceChildNameAvailability', 'Test-AzDataMigrationServiceNameAvailability', 'Test-AzDataMigrationServiceStatus', 'Update-AzDataMigrationFile', 'Update-AzDataMigrationProject', 'Update-AzDataMigrationService', 'Update-AzDataMigrationServiceTask', 'Update-AzDataMigrationSqlMigrationService', 'Update-AzDataMigrationTask', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'DataMigration' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/datamigration/Az.DataMigration.psm1 b/swaggerci/datamigration/Az.DataMigration.psm1 new file mode 100644 index 000000000000..f84f10e15223 --- /dev/null +++ b/swaggerci/datamigration/Az.DataMigration.psm1 @@ -0,0 +1,107 @@ +# region Generated + # ---------------------------------------------------------------------------------- + # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. + # ---------------------------------------------------------------------------------- + # Load required Az.Accounts module + $accountsName = 'Az.Accounts' + $accountsModule = Get-Module -Name $accountsName + if(-not $accountsModule) { + $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules' + if(Test-Path -Path $localAccountsPath) { + $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1 + if($localAccounts) { + $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru + } + } + if(-not $accountsModule) { + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 + if($hasAdequateVersion) { + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru + } + } + } + + if(-not $accountsModule) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + } + Write-Information "Loaded Module '$($accountsModule.Name)'" + + # Load the private module dll + $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DataMigration.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module]::Instance + + # Ask for the shared functionality table + $VTable = Register-AzModule + + # Tweaks the pipeline on module load + $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry + + + # Tweaks the pipeline per call + $instance.OnNewRequest = $VTable.OnNewRequest + + # Gets shared parameter values + $instance.GetParameterValue = $VTable.GetParameterValue + + # Allows shared module to listen to events from this module + $instance.EventListener = $VTable.EventListener + + # Gets shared argument completers + $instance.ArgumentCompleter = $VTable.ArgumentCompleter + + # The name of the currently selected Azure profile + $instance.ProfileName = $VTable.ProfileName + + + # Load the custom module + $customModulePath = Join-Path $PSScriptRoot './custom/Az.DataMigration.custom.psm1' + if(Test-Path $customModulePath) { + $null = Import-Module -Name $customModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = Join-Path $PSScriptRoot './exports' + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } + + # Finalize initialization of this module + $instance.Init(); + Write-Information "Loaded Module '$($instance.Name)'" +# endregion diff --git a/swaggerci/datamigration/MSSharedLibKey.snk b/swaggerci/datamigration/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/datamigration/MSSharedLibKey.snk differ diff --git a/swaggerci/datamigration/README.md b/swaggerci/datamigration/README.md new file mode 100644 index 000000000000..acea3cc421f3 --- /dev/null +++ b/swaggerci/datamigration/README.md @@ -0,0 +1,27 @@ + +# Az.DataMigration +This directory contains the PowerShell module for the DataMigration service. + +--- +## Status +[![Az.DataMigration](https://img.shields.io/powershellgallery/v/Az.DataMigration.svg?style=flat-square&label=Az.DataMigration "Az.DataMigration")](https://www.powershellgallery.com/packages/Az.DataMigration/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.DataMigration`, see [how-to.md](how-to.md). + diff --git a/swaggerci/datamigration/build-module.ps1 b/swaggerci/datamigration/build-module.ps1 new file mode 100644 index 000000000000..3b9868d172c0 --- /dev/null +++ b/swaggerci/datamigration/build-module.ps1 @@ -0,0 +1,153 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs) +$ErrorActionPreference = 'Stop' + +if($PSEdition -ne 'Core') { + Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' +} + +if(-not $Isolated -and -not $Debugger) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + + if($LastExitCode -ne 0) { + # Build failed. Don't attempt to run the module. + return + } + + if($Test) { + . (Join-Path $PSScriptRoot 'test-module.ps1') + if($LastExitCode -ne 0) { + # Tests failed. Don't attempt to run the module. + return + } + } + + if($Docs) { + . (Join-Path $PSScriptRoot 'generate-help.ps1') + if($LastExitCode -ne 0) { + # Docs generation failed. Don't attempt to run the module. + return + } + } + + if($Pack) { + . (Join-Path $PSScriptRoot 'pack-module.ps1') + if($LastExitCode -ne 0) { + # Packing failed. Don't attempt to run the module. + return + } + } + + $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1' + if($Code) { + . $runModulePath -Code + } elseif($Run) { + . $runModulePath + } else { + Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script." + } + return +} + +$binFolder = Join-Path $PSScriptRoot 'bin' +$objFolder = Join-Path $PSScriptRoot 'obj' + +if(-not $Debugger) { + Write-Host -ForegroundColor Green 'Cleaning build folders...' + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder + + if((Test-Path $binFolder) -or (Test-Path $objFolder)) { + Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?' + Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.' + } + + Write-Host -ForegroundColor Green 'Compiling module...' + $buildConfig = 'Debug' + if($Release) { + $buildConfig = 'Release' + } + dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo + if($LastExitCode -ne 0) { + Write-Error 'Compilation failed.' + } + + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release') +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.DataMigration.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} + +# Load DLL to use build-time cmdlets +$null = Import-Module -Name $dll + +$modulePaths = $dll +$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.DataMigration.custom.psm1' +if(Test-Path $customPsm1) { + $modulePaths = @($dll, $customPsm1) +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(Test-Path $exportsFolder) { + $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $exportsFolder + +$internalFolder = Join-Path $PSScriptRoot 'internal' +if(Test-Path $internalFolder) { + $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $internalFolder + +$psd1 = Join-Path $PSScriptRoot './Az.DataMigration.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.DataMigration' +$examplesFolder = Join-Path $PSScriptRoot 'examples' +$null = New-Item -ItemType Directory -Force -Path $examplesFolder + +Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' +$modelCmdlets = @() +if ($modelCmdlets.Count -gt 0) { + . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') + CreateModelCmdlet($modelCmdlets) +} + +if($NoDocs) { + Write-Host -ForegroundColor Green 'Creating exports...' + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder +} else { + Write-Host -ForegroundColor Green 'Creating exports and docs...' + $moduleDescription = 'Microsoft Azure PowerShell: DataMigration cmdlets' + $docsFolder = Join-Path $PSScriptRoot 'docs' + if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue + } + $null = New-Item -ItemType Directory -Force -Path $docsFolder + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid +} + +Write-Host -ForegroundColor Green 'Creating format.ps1xml...' +$formatPs1xml = Join-Path $PSScriptRoot './Az.DataMigration.format.ps1xml' +Export-FormatPs1xml -FilePath $formatPs1xml + +Write-Host -ForegroundColor Green 'Creating psd1...' +$customFolder = Join-Path $PSScriptRoot 'custom' +Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid + +Write-Host -ForegroundColor Green 'Creating test stubs...' +$testFolder = Join-Path $PSScriptRoot 'test' +$null = New-Item -ItemType Directory -Force -Path $testFolder +Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder + +Write-Host -ForegroundColor Green 'Creating example stubs...' +Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder + +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/swaggerci/datamigration/check-dependencies.ps1 b/swaggerci/datamigration/check-dependencies.ps1 new file mode 100644 index 000000000000..7400c6e1be47 --- /dev/null +++ b/swaggerci/datamigration/check-dependencies.ps1 @@ -0,0 +1,57 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) { + if($predicate) { + $module = Get-Module -ListAvailable -Name $moduleName + if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) { + $null = New-Item -ItemType Directory -Force -Path $path + Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..." + if ($requiredVersion) { + Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path + }elseif($versionMinimum) { + Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path + } else { + Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path + } + } + } +} + +$ProgressPreference = 'SilentlyContinue' +$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1 + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' +DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' + +$tools = Join-Path $PSScriptRoot 'tools' +$resourceDir = Join-Path $tools 'Resources' +$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1' + +if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) { + Write-Host -ForegroundColor Green "Building local Resource module used for test..." + Set-Location $resourceDir + $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources + $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/ + Set-Location $HOME/.PSSharedModules/Resources + $null = .\build-module.ps1 + Set-Location $PSScriptRoot +} diff --git a/swaggerci/datamigration/create-model-cmdlets.ps1 b/swaggerci/datamigration/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..40fd6f056a00 --- /dev/null +++ b/swaggerci/datamigration/create-model-cmdlets.ps1 @@ -0,0 +1,163 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $ModuleName = 'DataMigration' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + + $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs + $Content = '' + $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) + { $Content += get-content $_.fullname -raw + } } + + $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) + $Nodes = $Tree.ChildNodes().ChildNodes() + foreach ($Model in $Models) + { + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + if ($InterfaceNode.count -eq 0) { + continue + } + # through a queue, we iterate all the parent models. + $Queue = @($InterfaceNode) + $visited = @("I$Model") + $AllInterfaceNodes = @() + while ($Queue.count -ne 0) + { + $AllInterfaceNodes += $Queue[0] + # Baselist contains the direct parent models. + foreach ($parent in $Queue[0].BaseList.Types) + { + if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value))) + { + $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) }) + $visited = [Array]$visited + $parent.Type.Right.Identifier.Value + } + } + $first, $Queue = $Queue + } + + $Namespace = $InterfaceNode.Parent.Name + $ObjectType = $Model + $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" + # remove duplicated module name + if ($ObjectType.StartsWith($ModuleName)) { + $ModulePrefix = '' + } else { + $ModulePrefix = $ModuleName + } + $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir + + $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string] + $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string] + foreach ($Node in $AllInterfaceNodes) + { + foreach ($Member in $Node.Members) + { + $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments + $Required = $false + $Description = "" + $Readonly = $False + foreach ($Argument in $Arguments) + { + if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") + { + $Required = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Description") + { + $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"') + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly") + { + $Readonly = $Argument.Expression.Token.Value + } + } + if ($Readonly) + { + continue + } + $Identifier = $Member.Identifier.Value + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] + if ($Required) + { + $ParameterDefinePropertyList.Add("Mandatory") + } + if ($Description -ne "") + { + $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"") + } + $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) + # check whether completer is needed + $completer = ''; + if($Type.Split('.').Split('.')[-2] -eq 'Support') { + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" + } + $ParameterDefineScript = " + [Parameter($ParameterDefineProperty)]${completer} + [${Type}] + `$${Identifier}" + $ParameterDefineScriptList.Add($ParameterDefineScript) + $ParameterAssignScriptList.Add(" + if (`$PSBoundParameters.ContainsKey('${Identifier}')) { + `$Object.${Identifier} = `$${Identifier} + }") + } + } + $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," + $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + + $Script = " +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ${ObjectType}. +.Description +Create an in-memory object for ${ObjectType}. + +.Outputs +${ObjectTypeWithNamespace} +.Link +https://docs.microsoft.com/en-us/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +#> +function New-Az${ModulePrefix}${ObjectType}Object { + [OutputType('${ObjectTypeWithNamespace}')] + [CmdletBinding(PositionalBinding=`$false)] + Param( +${ParameterDefineScript} + ) + + process { + `$Object = [${ObjectTypeWithNamespace}]::New() +${ParameterAssignScript} + return `$Object + } +} +" + Set-Content -Path $OutputPath -Value $Script + } +} diff --git a/swaggerci/datamigration/custom/Az.DataMigration.custom.psm1 b/swaggerci/datamigration/custom/Az.DataMigration.custom.psm1 new file mode 100644 index 000000000000..1adf383694c2 --- /dev/null +++ b/swaggerci/datamigration/custom/Az.DataMigration.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.DataMigration.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.DataMigration.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/swaggerci/datamigration/custom/README.md b/swaggerci/datamigration/custom/README.md new file mode 100644 index 000000000000..e600ac86e956 --- /dev/null +++ b/swaggerci/datamigration/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.DataMigration` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.DataMigration.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.DataMigration` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.DataMigration.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.DataMigration.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.DataMigration`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.DataMigration`. +- `Microsoft.Azure.PowerShell.Cmdlets.DataMigration.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.DataMigration`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/swaggerci/datamigration/docs/Az.DataMigration.md b/swaggerci/datamigration/docs/Az.DataMigration.md new file mode 100644 index 000000000000..c8f0eca9b9a0 --- /dev/null +++ b/swaggerci/datamigration/docs/Az.DataMigration.md @@ -0,0 +1,210 @@ +--- +Module Name: Az.DataMigration +Module Guid: b49682f6-3563-4e8c-b685-8e8facd121e7 +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.datamigration +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.DataMigration Module +## Description +Microsoft Azure PowerShell: DataMigration cmdlets + +## Az.DataMigration Cmdlets +### [Get-AzDataMigrationDatabaseMigrationsSqlDb](Get-AzDataMigrationDatabaseMigrationsSqlDb.md) +Retrieve the Database Migration resource. + +### [Get-AzDataMigrationDatabaseMigrationsSqlMi](Get-AzDataMigrationDatabaseMigrationsSqlMi.md) +Retrieve the specified database migration for a given SQL Managed Instance. + +### [Get-AzDataMigrationDatabaseMigrationsSqlVM](Get-AzDataMigrationDatabaseMigrationsSqlVM.md) +Retrieve the specified database migration for a given SQL VM. + +### [Get-AzDataMigrationFile](Get-AzDataMigrationFile.md) +The files resource is a nested, proxy-only resource representing a file stored under the project resource. +This method retrieves information about a file. + +### [Get-AzDataMigrationProject](Get-AzDataMigrationProject.md) +The project resource is a nested resource representing a stored migration project. +The GET method retrieves information about a project. + +### [Get-AzDataMigrationResourceSku](Get-AzDataMigrationResourceSku.md) +The skus action returns the list of SKUs that DMS supports. + +### [Get-AzDataMigrationService](Get-AzDataMigrationService.md) +The services resource is the top-level resource that represents the Database Migration Service. +The GET method retrieves information about a service instance. + +### [Get-AzDataMigrationServiceSku](Get-AzDataMigrationServiceSku.md) +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. + +### [Get-AzDataMigrationServiceTask](Get-AzDataMigrationServiceTask.md) +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a service task. + +### [Get-AzDataMigrationSqlMigrationService](Get-AzDataMigrationSqlMigrationService.md) +Retrieve the Database Migration Service + +### [Get-AzDataMigrationSqlMigrationServiceAuthKey](Get-AzDataMigrationSqlMigrationServiceAuthKey.md) +Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + +### [Get-AzDataMigrationSqlMigrationServiceMigration](Get-AzDataMigrationSqlMigrationServiceMigration.md) +Retrieve the List of database migrations attached to the service. + +### [Get-AzDataMigrationSqlMigrationServiceMonitoringData](Get-AzDataMigrationSqlMigrationServiceMonitoringData.md) +Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. + +### [Get-AzDataMigrationTask](Get-AzDataMigrationTask.md) +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a task. + +### [Get-AzDataMigrationUsage](Get-AzDataMigrationUsage.md) +This method returns region-specific quotas and resource usage information for the Database Migration Service. + +### [Invoke-AzDataMigrationCommandTask](Invoke-AzDataMigrationCommandTask.md) +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method executes a command on a running task. + +### [Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi](Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.md) +Initiate cutover for in-progress online database migration to SQL Managed Instance. + +### [Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM](Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.md) +Initiate cutover for in-progress online database migration to SQL VM. + +### [New-AzDataMigrationDatabaseMigrationSqlDb](New-AzDataMigrationDatabaseMigrationSqlDb.md) +Create or Update Database Migration resource. + +### [New-AzDataMigrationDatabaseMigrationSqlMi](New-AzDataMigrationDatabaseMigrationSqlMi.md) +Create a new database migration to a given SQL Managed Instance. + +### [New-AzDataMigrationDatabaseMigrationSqlVM](New-AzDataMigrationDatabaseMigrationSqlVM.md) +Create a new database migration to a given SQL VM. + +### [New-AzDataMigrationFile](New-AzDataMigrationFile.md) +The PUT method creates a new file or updates an existing one. + +### [New-AzDataMigrationProject](New-AzDataMigrationProject.md) +The project resource is a nested resource representing a stored migration project. +The PUT method creates a new project or updates an existing one. + +### [New-AzDataMigrationService](New-AzDataMigrationService.md) +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 (\"ServiceIsBusy\"). +The provider will reply when successful with 200 OK or 201 Created. +Long-running operations use the provisioningState property. + +### [New-AzDataMigrationServiceTask](New-AzDataMigrationServiceTask.md) +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one. + +### [New-AzDataMigrationSqlMigrationService](New-AzDataMigrationSqlMigrationService.md) +Create or Update Database Migration Service. + +### [New-AzDataMigrationSqlMigrationServiceAuthKey](New-AzDataMigrationSqlMigrationServiceAuthKey.md) +Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + +### [New-AzDataMigrationTask](New-AzDataMigrationTask.md) +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. + +### [Read-AzDataMigrationFile](Read-AzDataMigrationFile.md) +This method is used for requesting storage information using which contents of the file can be downloaded. + +### [Read-AzDataMigrationFileWrite](Read-AzDataMigrationFileWrite.md) +This method is used for requesting information for reading and writing the file content. + +### [Remove-AzDataMigrationDatabaseMigrationsSqlDb](Remove-AzDataMigrationDatabaseMigrationsSqlDb.md) +Delete Database Migration resource. + +### [Remove-AzDataMigrationFile](Remove-AzDataMigrationFile.md) +This method deletes a file. + +### [Remove-AzDataMigrationProject](Remove-AzDataMigrationProject.md) +The project resource is a nested resource representing a stored migration project. +The DELETE method deletes a project. + +### [Remove-AzDataMigrationService](Remove-AzDataMigrationService.md) +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. + +### [Remove-AzDataMigrationServiceTask](Remove-AzDataMigrationServiceTask.md) +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The DELETE method deletes a service task, canceling it first if it's running. + +### [Remove-AzDataMigrationSqlMigrationService](Remove-AzDataMigrationSqlMigrationService.md) +Delete Database Migration Service. + +### [Remove-AzDataMigrationSqlMigrationServiceNode](Remove-AzDataMigrationSqlMigrationServiceNode.md) +Delete the integration runtime node. + +### [Remove-AzDataMigrationTask](Remove-AzDataMigrationTask.md) +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. + +### [Start-AzDataMigrationService](Start-AzDataMigrationService.md) +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. + +### [Stop-AzDataMigrationDatabaseMigrationsSqlDb](Stop-AzDataMigrationDatabaseMigrationsSqlDb.md) +Stop on going migration for the database. + +### [Stop-AzDataMigrationDatabaseMigrationsSqlMi](Stop-AzDataMigrationDatabaseMigrationsSqlMi.md) +Stop in-progress database migration to SQL Managed Instance. + +### [Stop-AzDataMigrationDatabaseMigrationsSqlVM](Stop-AzDataMigrationDatabaseMigrationsSqlVM.md) +Stop in-progress database migration to SQL VM. + +### [Stop-AzDataMigrationService](Stop-AzDataMigrationService.md) +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. + +### [Stop-AzDataMigrationServiceTask](Stop-AzDataMigrationServiceTask.md) +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method cancels a service task if it's currently queued or running. + +### [Stop-AzDataMigrationTask](Stop-AzDataMigrationTask.md) +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. + +### [Test-AzDataMigrationServiceChildNameAvailability](Test-AzDataMigrationServiceChildNameAvailability.md) +This method checks whether a proposed nested resource name is valid and available. + +### [Test-AzDataMigrationServiceNameAvailability](Test-AzDataMigrationServiceNameAvailability.md) +This method checks whether a proposed top-level resource name is valid and available. + +### [Test-AzDataMigrationServiceStatus](Test-AzDataMigrationServiceStatus.md) +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. + +### [Update-AzDataMigrationFile](Update-AzDataMigrationFile.md) +This method updates an existing file. + +### [Update-AzDataMigrationProject](Update-AzDataMigrationProject.md) +The project resource is a nested resource representing a stored migration project. +The PATCH method updates an existing project. + +### [Update-AzDataMigrationService](Update-AzDataMigrationService.md) +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\"). + +### [Update-AzDataMigrationServiceTask](Update-AzDataMigrationServiceTask.md) +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so. + +### [Update-AzDataMigrationSqlMigrationService](Update-AzDataMigrationSqlMigrationService.md) +Update Database Migration Service. + +### [Update-AzDataMigrationTask](Update-AzDataMigrationTask.md) +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. + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlDb.md b/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlDb.md new file mode 100644 index 000000000000..8a40e40b85a4 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlDb.md @@ -0,0 +1,233 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqldb +schema: 2.0.0 +--- + +# Get-AzDataMigrationDatabaseMigrationsSqlDb + +## SYNOPSIS +Retrieve the Database Migration resource. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataMigrationDatabaseMigrationsSqlDb -ResourceGroupName -SqlDbInstanceName + -TargetDbName [-SubscriptionId ] [-Expand ] [-MigrationOperationId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationDatabaseMigrationsSqlDb -InputObject [-Expand ] + [-MigrationOperationId ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Retrieve the Database Migration resource. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Complete migration details be included in the response. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlDbInstanceName +. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlMi.md b/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlMi.md new file mode 100644 index 000000000000..8e80dc0b212d --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlMi.md @@ -0,0 +1,233 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqlmi +schema: 2.0.0 +--- + +# Get-AzDataMigrationDatabaseMigrationsSqlMi + +## SYNOPSIS +Retrieve the specified database migration for a given SQL Managed Instance. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataMigrationDatabaseMigrationsSqlMi -ManagedInstanceName -ResourceGroupName + -TargetDbName [-SubscriptionId ] [-Expand ] [-MigrationOperationId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationDatabaseMigrationsSqlMi -InputObject [-Expand ] + [-MigrationOperationId ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Retrieve the specified database migration for a given SQL Managed Instance. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Complete migration details be included in the response. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagedInstanceName +. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlVM.md b/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlVM.md new file mode 100644 index 000000000000..4a41dd0c9d25 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationDatabaseMigrationsSqlVM.md @@ -0,0 +1,233 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqlvm +schema: 2.0.0 +--- + +# Get-AzDataMigrationDatabaseMigrationsSqlVM + +## SYNOPSIS +Retrieve the specified database migration for a given SQL VM. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataMigrationDatabaseMigrationsSqlVM -ResourceGroupName -SqlVirtualMachineName + -TargetDbName [-SubscriptionId ] [-Expand ] [-MigrationOperationId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationDatabaseMigrationsSqlVM -InputObject [-Expand ] + [-MigrationOperationId ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Retrieve the specified database migration for a given SQL VM. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Complete migration details be included in the response. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlVirtualMachineName +. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationFile.md b/swaggerci/datamigration/docs/Get-AzDataMigrationFile.md new file mode 100644 index 000000000000..0cb9b91320a4 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationFile.md @@ -0,0 +1,207 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationfile +schema: 2.0.0 +--- + +# Get-AzDataMigrationFile + +## SYNOPSIS +The files resource is a nested, proxy-only resource representing a file stored under the project resource. +This method retrieves information about a file. + +## SYNTAX + +### List (Default) +``` +Get-AzDataMigrationFile -GroupName -ProjectName -ServiceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataMigrationFile -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationFile -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +The files resource is a nested, proxy-only resource representing a file stored under the project resource. +This method retrieves information about a file. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the File + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: FileName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationProject.md b/swaggerci/datamigration/docs/Get-AzDataMigrationProject.md new file mode 100644 index 000000000000..30d48693dd28 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationProject.md @@ -0,0 +1,192 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationproject +schema: 2.0.0 +--- + +# Get-AzDataMigrationProject + +## SYNOPSIS +The project resource is a nested resource representing a stored migration project. +The GET method retrieves information about a project. + +## SYNTAX + +### List (Default) +``` +Get-AzDataMigrationProject -GroupName -ServiceName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataMigrationProject -GroupName -Name -ServiceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationProject -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +The project resource is a nested resource representing a stored migration project. +The GET method retrieves information about a project. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the project + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ProjectName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationResourceSku.md b/swaggerci/datamigration/docs/Get-AzDataMigrationResourceSku.md new file mode 100644 index 000000000000..9aeb8cba0c78 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationResourceSku.md @@ -0,0 +1,92 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationresourcesku +schema: 2.0.0 +--- + +# Get-AzDataMigrationResourceSku + +## SYNOPSIS +The skus action returns the list of SKUs that DMS supports. + +## SYNTAX + +``` +Get-AzDataMigrationResourceSku [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +The skus action returns the list of SKUs that DMS supports. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationService.md b/swaggerci/datamigration/docs/Get-AzDataMigrationService.md new file mode 100644 index 000000000000..5ab716168316 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationService.md @@ -0,0 +1,182 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservice +schema: 2.0.0 +--- + +# Get-AzDataMigrationService + +## SYNOPSIS +The services resource is the top-level resource that represents the Database Migration Service. +The GET method retrieves information about a service instance. + +## SYNTAX + +### List1 (Default) +``` +Get-AzDataMigrationService [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataMigrationService -GroupName -Name [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationService -InputObject [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzDataMigrationService -GroupName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +The services resource is the top-level resource that represents the Database Migration Service. +The GET method retrieves information about a service instance. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the service + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationServiceSku.md b/swaggerci/datamigration/docs/Get-AzDataMigrationServiceSku.md new file mode 100644 index 000000000000..83b68081a5c7 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationServiceSku.md @@ -0,0 +1,125 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservicesku +schema: 2.0.0 +--- + +# Get-AzDataMigrationServiceSku + +## SYNOPSIS +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. + +## SYNTAX + +``` +Get-AzDataMigrationServiceSku -GroupName -ServiceName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationServiceTask.md b/swaggerci/datamigration/docs/Get-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..55dda45cf0eb --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationServiceTask.md @@ -0,0 +1,222 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservicetask +schema: 2.0.0 +--- + +# Get-AzDataMigrationServiceTask + +## SYNOPSIS +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a service task. + +## SYNTAX + +### List (Default) +``` +Get-AzDataMigrationServiceTask -GroupName -ServiceName [-SubscriptionId ] + [-TaskType ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataMigrationServiceTask -GroupName -ServiceName -TaskName + [-SubscriptionId ] [-Expand ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationServiceTask -InputObject [-Expand ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a service task. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Expand the response + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskName +Name of the Task + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskType +Filter tasks by task type + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..4bcf356e0957 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,197 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservice +schema: 2.0.0 +--- + +# Get-AzDataMigrationSqlMigrationService + +## SYNOPSIS +Retrieve the Database Migration Service + +## SYNTAX + +### List1 (Default) +``` +Get-AzDataMigrationSqlMigrationService [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzDataMigrationSqlMigrationService -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationSqlMigrationService -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +### List +``` +Get-AzDataMigrationSqlMigrationService -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Retrieve the Database Migration Service + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: SqlMigrationServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceAuthKey.md b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceAuthKey.md new file mode 100644 index 000000000000..97427300d8ae --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceAuthKey.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationserviceauthkey +schema: 2.0.0 +--- + +# Get-AzDataMigrationSqlMigrationServiceAuthKey + +## SYNOPSIS +Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + +## SYNTAX + +``` +Get-AzDataMigrationSqlMigrationServiceAuthKey -ResourceGroupName -SqlMigrationServiceName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlMigrationServiceName +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceMigration.md b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceMigration.md new file mode 100644 index 000000000000..2c8db1460d57 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceMigration.md @@ -0,0 +1,139 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservicemigration +schema: 2.0.0 +--- + +# Get-AzDataMigrationSqlMigrationServiceMigration + +## SYNOPSIS +Retrieve the List of database migrations attached to the service. + +## SYNTAX + +``` +Get-AzDataMigrationSqlMigrationServiceMigration -ResourceGroupName -SqlMigrationServiceName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Retrieve the List of database migrations attached to the service. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlMigrationServiceName +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceMonitoringData.md b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceMonitoringData.md new file mode 100644 index 000000000000..4291332782fc --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationSqlMigrationServiceMonitoringData.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservicemonitoringdata +schema: 2.0.0 +--- + +# Get-AzDataMigrationSqlMigrationServiceMonitoringData + +## SYNOPSIS +Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. + +## SYNTAX + +``` +Get-AzDataMigrationSqlMigrationServiceMonitoringData -ResourceGroupName + -SqlMigrationServiceName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlMigrationServiceName +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationTask.md b/swaggerci/datamigration/docs/Get-AzDataMigrationTask.md new file mode 100644 index 000000000000..47c390c1f529 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationTask.md @@ -0,0 +1,237 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationtask +schema: 2.0.0 +--- + +# Get-AzDataMigrationTask + +## SYNOPSIS +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a task. + +## SYNTAX + +### List (Default) +``` +Get-AzDataMigrationTask -GroupName -ProjectName -ServiceName + [-SubscriptionId ] [-TaskType ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataMigrationTask -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-Expand ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataMigrationTask -InputObject [-Expand ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a task. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Expand the response + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the Task + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: TaskName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskType +Filter tasks by task type + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Get-AzDataMigrationUsage.md b/swaggerci/datamigration/docs/Get-AzDataMigrationUsage.md new file mode 100644 index 000000000000..a8411f74b612 --- /dev/null +++ b/swaggerci/datamigration/docs/Get-AzDataMigrationUsage.md @@ -0,0 +1,108 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationusage +schema: 2.0.0 +--- + +# Get-AzDataMigrationUsage + +## SYNOPSIS +This method returns region-specific quotas and resource usage information for the Database Migration Service. + +## SYNTAX + +``` +Get-AzDataMigrationUsage -Location [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +This method returns region-specific quotas and resource usage information for the Database Migration Service. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The Azure region of the operation + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Invoke-AzDataMigrationCommandTask.md b/swaggerci/datamigration/docs/Invoke-AzDataMigrationCommandTask.md new file mode 100644 index 000000000000..a2ba29a4b946 --- /dev/null +++ b/swaggerci/datamigration/docs/Invoke-AzDataMigrationCommandTask.md @@ -0,0 +1,283 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcommandtask +schema: 2.0.0 +--- + +# Invoke-AzDataMigrationCommandTask + +## SYNOPSIS +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method executes a command on a running task. + +## SYNTAX + +### CommandExpanded (Default) +``` +Invoke-AzDataMigrationCommandTask -GroupName -ProjectName -ServiceName + -TaskName -CommandType [-SubscriptionId ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### Command +``` +Invoke-AzDataMigrationCommandTask -GroupName -ProjectName -ServiceName + -TaskName -Parameter [-SubscriptionId ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### CommandViaIdentity +``` +Invoke-AzDataMigrationCommandTask -InputObject -Parameter + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CommandViaIdentityExpanded +``` +Invoke-AzDataMigrationCommandTask -InputObject -CommandType + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method executes a command on a running task. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -CommandType +Command type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType +Parameter Sets: CommandExpanded, CommandViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Command, CommandExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CommandViaIdentity, CommandViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Parameter +Base class for all types of DMS command properties. +If command is not supported by current client, this object is returned. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties +Parameter Sets: Command, CommandViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Command, CommandExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Command, CommandExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Command, CommandExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskName +Name of the Task + +```yaml +Type: System.String +Parameter Sets: Command, CommandExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + - `CommandType `: Command type. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.md b/swaggerci/datamigration/docs/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.md new file mode 100644 index 000000000000..0ac88ad5d641 --- /dev/null +++ b/swaggerci/datamigration/docs/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.md @@ -0,0 +1,313 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcutoverdatabasemigrationsqlmi +schema: 2.0.0 +--- + +# Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi + +## SYNOPSIS +Initiate cutover for in-progress online database migration to SQL Managed Instance. + +## SYNTAX + +### CutoverExpanded (Default) +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi -ManagedInstanceName -ResourceGroupName + -TargetDbName [-SubscriptionId ] [-MigrationOperationId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Cutover +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi -ManagedInstanceName -ResourceGroupName + -TargetDbName -Parameter [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CutoverViaIdentity +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### CutoverViaIdentityExpanded +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi -InputObject + [-MigrationOperationId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Initiate cutover for in-progress online database migration to SQL Managed Instance. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CutoverViaIdentity, CutoverViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagedInstanceName +. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking migration operation. + +```yaml +Type: System.String +Parameter Sets: CutoverExpanded, CutoverViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Migration Operation Input +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +Parameter Sets: Cutover, CutoverViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : Migration Operation Input + - `[MigrationOperationId ]`: ID tracking migration operation. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.md b/swaggerci/datamigration/docs/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.md new file mode 100644 index 000000000000..be851eac8df4 --- /dev/null +++ b/swaggerci/datamigration/docs/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.md @@ -0,0 +1,315 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcutoverdatabasemigrationsqlvm +schema: 2.0.0 +--- + +# Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM + +## SYNOPSIS +Initiate cutover for in-progress online database migration to SQL VM. + +## SYNTAX + +### CutoverExpanded (Default) +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM -ResourceGroupName + -SqlVirtualMachineName -TargetDbName [-SubscriptionId ] + [-MigrationOperationId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### Cutover +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM -ResourceGroupName + -SqlVirtualMachineName -TargetDbName -Parameter + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### CutoverViaIdentity +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### CutoverViaIdentityExpanded +``` +Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM -InputObject + [-MigrationOperationId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Initiate cutover for in-progress online database migration to SQL VM. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CutoverViaIdentity, CutoverViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking migration operation. + +```yaml +Type: System.String +Parameter Sets: CutoverExpanded, CutoverViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Migration Operation Input +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +Parameter Sets: Cutover, CutoverViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlVirtualMachineName +. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Cutover, CutoverExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : Migration Operation Input + - `[MigrationOperationId ]`: ID tracking migration operation. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlDb.md b/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlDb.md new file mode 100644 index 000000000000..cf6f0de9e4be --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlDb.md @@ -0,0 +1,524 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqldb +schema: 2.0.0 +--- + +# New-AzDataMigrationDatabaseMigrationSqlDb + +## SYNOPSIS +Create or Update Database Migration resource. + +## SYNTAX + +``` +New-AzDataMigrationDatabaseMigrationSqlDb -ResourceGroupName -SqlDbInstanceName + -TargetDbName [-SubscriptionId ] [-Kind ] [-MigrationOperationId ] + [-MigrationService ] [-ProvisioningError ] [-Scope ] [-SourceDatabaseName ] + [-SourceSqlConnectionAuthentication ] [-SourceSqlConnectionDataSource ] + [-SourceSqlConnectionEncryptConnection] [-SourceSqlConnectionPassword ] + [-SourceSqlConnectionTrustServerCertificate] [-SourceSqlConnectionUserName ] [-TableList ] + [-TargetDatabaseCollation ] [-TargetSqlConnectionAuthentication ] + [-TargetSqlConnectionDataSource ] [-TargetSqlConnectionEncryptConnection] + [-TargetSqlConnectionPassword ] [-TargetSqlConnectionTrustServerCertificate] + [-TargetSqlConnectionUserName ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or Update Database Migration resource. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking current migration operation. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationService +Resource Id of the Migration Service. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisioningError +Error message for migration provisioning failure, if any. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +Resource Id of the target resource (SQL VM or SQL Managed Instance). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceDatabaseName +Name of the source database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionAuthentication +Authentication type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionDataSource +Data source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionEncryptConnection +Whether to encrypt connection or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionPassword +Password to connect to source SQL. + +```yaml +Type: System.Security.SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionTrustServerCertificate +Whether to trust server certificate or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionUserName +User name to connect to source SQL. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlDbInstanceName +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TableList +List of tables to copy. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDatabaseCollation +Database collation to be used for the target database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetSqlConnectionAuthentication +Authentication type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetSqlConnectionDataSource +Data source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetSqlConnectionEncryptConnection +Whether to encrypt connection or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetSqlConnectionPassword +Password to connect to source SQL. + +```yaml +Type: System.Security.SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetSqlConnectionTrustServerCertificate +Whether to trust server certificate or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetSqlConnectionUserName +User name to connect to source SQL. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlMi.md b/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlMi.md new file mode 100644 index 000000000000..fdd7cd27dfd7 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlMi.md @@ -0,0 +1,572 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqlmi +schema: 2.0.0 +--- + +# New-AzDataMigrationDatabaseMigrationSqlMi + +## SYNOPSIS +Create a new database migration to a given SQL Managed Instance. + +## SYNTAX + +``` +New-AzDataMigrationDatabaseMigrationSqlMi -ManagedInstanceName -ResourceGroupName + -TargetDbName [-SubscriptionId ] [-AzureBlobAccountKey ] + [-AzureBlobContainerName ] [-AzureBlobStorageAccountResourceId ] + [-FileSharePassword ] [-FileSharePath ] [-FileShareUsername ] + [-Kind ] [-MigrationOperationId ] [-MigrationService ] + [-OfflineConfigurationLastBackupName ] [-OfflineConfigurationOffline] [-ProvisioningError ] + [-Scope ] [-SourceDatabaseName ] [-SourceSqlConnectionAuthentication ] + [-SourceSqlConnectionDataSource ] [-SourceSqlConnectionEncryptConnection] + [-SourceSqlConnectionPassword ] [-SourceSqlConnectionTrustServerCertificate] + [-SourceSqlConnectionUserName ] [-TargetDatabaseCollation ] + [-TargetLocationAccountKey ] [-TargetLocationStorageAccountResourceId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a new database migration to a given SQL Managed Instance. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureBlobAccountKey +Storage Account Key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureBlobContainerName +Blob container name where backups are stored. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureBlobStorageAccountResourceId +Resource Id of the storage account where backups are stored. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePassword +Password for username to access file share location. + +```yaml +Type: System.Security.SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePath +Location as SMB share or local drive where backups are placed. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileShareUsername +Username to access the file share location for backups. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagedInstanceName +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking current migration operation. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationService +Resource Id of the Migration Service. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfflineConfigurationLastBackupName +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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfflineConfigurationOffline +Offline migration + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisioningError +Error message for migration provisioning failure, if any. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +Resource Id of the target resource (SQL VM or SQL Managed Instance). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceDatabaseName +Name of the source database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionAuthentication +Authentication type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionDataSource +Data source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionEncryptConnection +Whether to encrypt connection or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionPassword +Password to connect to source SQL. + +```yaml +Type: System.Security.SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionTrustServerCertificate +Whether to trust server certificate or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionUserName +User name to connect to source SQL. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDatabaseCollation +Database collation to be used for the target database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetLocationAccountKey +Storage Account Key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetLocationStorageAccountResourceId +Resource Id of the storage account copying backups. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlVM.md b/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlVM.md new file mode 100644 index 000000000000..b01f5c07c6e3 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationDatabaseMigrationSqlVM.md @@ -0,0 +1,572 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqlvm +schema: 2.0.0 +--- + +# New-AzDataMigrationDatabaseMigrationSqlVM + +## SYNOPSIS +Create a new database migration to a given SQL VM. + +## SYNTAX + +``` +New-AzDataMigrationDatabaseMigrationSqlVM -ResourceGroupName -SqlVirtualMachineName + -TargetDbName [-SubscriptionId ] [-AzureBlobAccountKey ] + [-AzureBlobContainerName ] [-AzureBlobStorageAccountResourceId ] + [-FileSharePassword ] [-FileSharePath ] [-FileShareUsername ] + [-Kind ] [-MigrationOperationId ] [-MigrationService ] + [-OfflineConfigurationLastBackupName ] [-OfflineConfigurationOffline] [-ProvisioningError ] + [-Scope ] [-SourceDatabaseName ] [-SourceSqlConnectionAuthentication ] + [-SourceSqlConnectionDataSource ] [-SourceSqlConnectionEncryptConnection] + [-SourceSqlConnectionPassword ] [-SourceSqlConnectionTrustServerCertificate] + [-SourceSqlConnectionUserName ] [-TargetDatabaseCollation ] + [-TargetLocationAccountKey ] [-TargetLocationStorageAccountResourceId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a new database migration to a given SQL VM. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureBlobAccountKey +Storage Account Key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureBlobContainerName +Blob container name where backups are stored. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureBlobStorageAccountResourceId +Resource Id of the storage account where backups are stored. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePassword +Password for username to access file share location. + +```yaml +Type: System.Security.SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePath +Location as SMB share or local drive where backups are placed. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileShareUsername +Username to access the file share location for backups. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking current migration operation. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationService +Resource Id of the Migration Service. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfflineConfigurationLastBackupName +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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfflineConfigurationOffline +Offline migration + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisioningError +Error message for migration provisioning failure, if any. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +Resource Id of the target resource (SQL VM or SQL Managed Instance). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceDatabaseName +Name of the source database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionAuthentication +Authentication type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionDataSource +Data source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionEncryptConnection +Whether to encrypt connection or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionPassword +Password to connect to source SQL. + +```yaml +Type: System.Security.SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionTrustServerCertificate +Whether to trust server certificate or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceSqlConnectionUserName +User name to connect to source SQL. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlVirtualMachineName +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDatabaseCollation +Database collation to be used for the target database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetLocationAccountKey +Storage Account Key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetLocationStorageAccountResourceId +Resource Id of the storage account copying backups. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationFile.md b/swaggerci/datamigration/docs/New-AzDataMigrationFile.md new file mode 100644 index 000000000000..450afac05239 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationFile.md @@ -0,0 +1,249 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationfile +schema: 2.0.0 +--- + +# New-AzDataMigrationFile + +## SYNOPSIS +The PUT method creates a new file or updates an existing one. + +## SYNTAX + +``` +New-AzDataMigrationFile -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-Etag ] [-Extension ] [-FilePath ] [-MediaType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The PUT method creates a new file or updates an existing one. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Extension +Optional File extension. +If submitted it should not have a leading period and must match the extension from filePath. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilePath +Relative path of this file resource. +This property can be set when creating or updating the file resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MediaType +File content type. +This property can be modified to reflect the file content type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the File + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: FileName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationProject.md b/swaggerci/datamigration/docs/New-AzDataMigrationProject.md new file mode 100644 index 000000000000..fb53edeaa668 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationProject.md @@ -0,0 +1,428 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationproject +schema: 2.0.0 +--- + +# New-AzDataMigrationProject + +## SYNOPSIS +The project resource is a nested resource representing a stored migration project. +The PUT method creates a new project or updates an existing one. + +## SYNTAX + +``` +New-AzDataMigrationProject -GroupName -Name -ServiceName [-SubscriptionId ] + [-AzureAuthenticationInfoAppKey ] [-AzureAuthenticationInfoApplicationId ] + [-AzureAuthenticationInfoIgnoreAzurePermission] [-AzureAuthenticationInfoTenantId ] + [-DatabasesInfo ] [-Etag ] [-Location ] + [-SourceConnectionInfoPassword ] [-SourceConnectionInfoType ] + [-SourceConnectionInfoUserName ] [-SourcePlatform ] [-Tag ] + [-TargetConnectionInfoPassword ] [-TargetConnectionInfoType ] + [-TargetConnectionInfoUserName ] [-TargetPlatform ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The project resource is a nested resource representing a stored migration project. +The PUT method creates a new project or updates an existing one. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AzureAuthenticationInfoAppKey +Key used to authenticate to the Azure Active Directory Application + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureAuthenticationInfoApplicationId +Application ID of the Azure Active Directory Application + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureAuthenticationInfoIgnoreAzurePermission +Ignore checking azure permissions on the AAD app + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureAuthenticationInfoTenantId +Tenant id of the customer + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatabasesInfo +List of DatabaseInfo +To construct, see NOTES section for DATABASESINFO properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the project + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ProjectName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceConnectionInfoPassword +Password credential. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceConnectionInfoType +Type of connection info + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceConnectionInfoUserName +User name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourcePlatform +Source platform for the project + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Dictionary of \ + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetConnectionInfoPassword +Password credential. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetConnectionInfoType +Type of connection info + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetConnectionInfoUserName +User name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetPlatform +Target platform for the project + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +DATABASESINFO : List of DatabaseInfo + - `SourceDatabaseName `: Name of the database + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationService.md b/swaggerci/datamigration/docs/New-AzDataMigrationService.md new file mode 100644 index 000000000000..af09ce5c7528 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationService.md @@ -0,0 +1,418 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationservice +schema: 2.0.0 +--- + +# New-AzDataMigrationService + +## SYNOPSIS +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 (\"ServiceIsBusy\"). +The provider will reply when successful with 200 OK or 201 Created. +Long-running operations use the provisioningState property. + +## SYNTAX + +``` +New-AzDataMigrationService -GroupName -Name [-SubscriptionId ] + [-AutoStopDelay ] [-DeleteResourcesOnStop] [-Etag ] [-Kind ] [-Location ] + [-PublicKey ] [-SkuCapacity ] [-SkuFamily ] [-SkuName ] [-SkuSize ] + [-SkuTier ] [-Tag ] [-VirtualNicId ] [-VirtualSubnetId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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 (\"ServiceIsBusy\"). +The provider will reply when successful with 200 OK or 201 Created. +Long-running operations use the provisioningState property. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoStopDelay +The time delay before the service is auto-stopped when idle. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeleteResourcesOnStop +Whether service resources should be deleted when stopped. +(Turned on by default) + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +Ignored if submitted + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +The resource kind. +Only 'vm' (the default) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicKey +The public key of the service, used to encrypt secrets sent to the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuCapacity +The capacity of the SKU, if it supports scaling + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuFamily +The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. +for virtual machines + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The unique name of the SKU, such as 'P3' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuSize +The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. +'A1' for virtual machines + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuTier +The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Dictionary of \ + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VirtualNicId +The ID of the Microsoft.Network/networkInterfaces resource which the service have + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VirtualSubnetId +The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationServiceTask.md b/swaggerci/datamigration/docs/New-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..c0d1ba5c3af1 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationServiceTask.md @@ -0,0 +1,218 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationservicetask +schema: 2.0.0 +--- + +# New-AzDataMigrationServiceTask + +## SYNOPSIS +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one. + +## SYNTAX + +``` +New-AzDataMigrationServiceTask -GroupName -ServiceName -TaskName + [-SubscriptionId ] [-ClientData ] [-Etag ] [-TaskType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ClientData +Key value pairs of client data to attach meta data information to task + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskName +Name of the Task + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskType +Task type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/docs/New-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..9d41793e0c57 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,231 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationsqlmigrationservice +schema: 2.0.0 +--- + +# New-AzDataMigrationSqlMigrationService + +## SYNOPSIS +Create or Update Database Migration Service. + +## SYNTAX + +``` +New-AzDataMigrationSqlMigrationService -Name -ResourceGroupName [-SubscriptionId ] + [-Location ] [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or Update Database Migration Service. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: SqlMigrationServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Dictionary of \ + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationSqlMigrationServiceAuthKey.md b/swaggerci/datamigration/docs/New-AzDataMigrationSqlMigrationServiceAuthKey.md new file mode 100644 index 000000000000..cb4b9c04ef88 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationSqlMigrationServiceAuthKey.md @@ -0,0 +1,300 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationsqlmigrationserviceauthkey +schema: 2.0.0 +--- + +# New-AzDataMigrationSqlMigrationServiceAuthKey + +## SYNOPSIS +Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + +## SYNTAX + +### RegenerateExpanded (Default) +``` +New-AzDataMigrationSqlMigrationServiceAuthKey -ResourceGroupName -SqlMigrationServiceName + [-SubscriptionId ] [-AuthKey1 ] [-AuthKey2 ] [-KeyName ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Regenerate +``` +New-AzDataMigrationSqlMigrationServiceAuthKey -ResourceGroupName -SqlMigrationServiceName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### RegenerateViaIdentity +``` +New-AzDataMigrationSqlMigrationServiceAuthKey -InputObject + -Parameter [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### RegenerateViaIdentityExpanded +``` +New-AzDataMigrationSqlMigrationServiceAuthKey -InputObject [-AuthKey1 ] + [-AuthKey2 ] [-KeyName ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AuthKey1 +The first authentication key. + +```yaml +Type: System.String +Parameter Sets: RegenerateExpanded, RegenerateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthKey2 +The second authentication key. + +```yaml +Type: System.String +Parameter Sets: RegenerateExpanded, RegenerateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: RegenerateViaIdentity, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -KeyName +The name of authentication key to generate. + +```yaml +Type: System.String +Parameter Sets: RegenerateExpanded, RegenerateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +An authentication key to regenerate. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys +Parameter Sets: Regenerate, RegenerateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlMigrationServiceName +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : An authentication key to regenerate. + - `[AuthKey1 ]`: The first authentication key. + - `[AuthKey2 ]`: The second authentication key. + - `[KeyName ]`: The name of authentication key to generate. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/New-AzDataMigrationTask.md b/swaggerci/datamigration/docs/New-AzDataMigrationTask.md new file mode 100644 index 000000000000..f701f4a7be46 --- /dev/null +++ b/swaggerci/datamigration/docs/New-AzDataMigrationTask.md @@ -0,0 +1,233 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationtask +schema: 2.0.0 +--- + +# New-AzDataMigrationTask + +## SYNOPSIS +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. + +## SYNTAX + +``` +New-AzDataMigrationTask -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-ClientData ] [-Etag ] [-TaskType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ClientData +Key value pairs of client data to attach meta data information to task + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the Task + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: TaskName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskType +Task type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/README.md b/swaggerci/datamigration/docs/README.md new file mode 100644 index 000000000000..963428e376dd --- /dev/null +++ b/swaggerci/datamigration/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.DataMigration` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.DataMigration` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/swaggerci/datamigration/docs/Read-AzDataMigrationFile.md b/swaggerci/datamigration/docs/Read-AzDataMigrationFile.md new file mode 100644 index 000000000000..5593587c301d --- /dev/null +++ b/swaggerci/datamigration/docs/Read-AzDataMigrationFile.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/read-azdatamigrationfile +schema: 2.0.0 +--- + +# Read-AzDataMigrationFile + +## SYNOPSIS +This method is used for requesting storage information using which contents of the file can be downloaded. + +## SYNTAX + +### Read (Default) +``` +Read-AzDataMigrationFile -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### ReadViaIdentity +``` +Read-AzDataMigrationFile -InputObject [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +This method is used for requesting storage information using which contents of the file can be downloaded. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: ReadViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the File + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: FileName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Read-AzDataMigrationFileWrite.md b/swaggerci/datamigration/docs/Read-AzDataMigrationFileWrite.md new file mode 100644 index 000000000000..c6e0b6ed8c77 --- /dev/null +++ b/swaggerci/datamigration/docs/Read-AzDataMigrationFileWrite.md @@ -0,0 +1,231 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/read-azdatamigrationfilewrite +schema: 2.0.0 +--- + +# Read-AzDataMigrationFileWrite + +## SYNOPSIS +This method is used for requesting information for reading and writing the file content. + +## SYNTAX + +### Read (Default) +``` +Read-AzDataMigrationFileWrite -FileName -GroupName -ProjectName + -ServiceName [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### ReadViaIdentity +``` +Read-AzDataMigrationFileWrite -InputObject [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +This method is used for requesting information for reading and writing the file content. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileName +Name of the File + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: ReadViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Read +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationDatabaseMigrationsSqlDb.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationDatabaseMigrationsSqlDb.md new file mode 100644 index 000000000000..bffd2f9dc35c --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationDatabaseMigrationsSqlDb.md @@ -0,0 +1,278 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationdatabasemigrationssqldb +schema: 2.0.0 +--- + +# Remove-AzDataMigrationDatabaseMigrationsSqlDb + +## SYNOPSIS +Delete Database Migration resource. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataMigrationDatabaseMigrationsSqlDb -ResourceGroupName -SqlDbInstanceName + -TargetDbName [-SubscriptionId ] [-Force] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationDatabaseMigrationsSqlDb -InputObject [-Force] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete Database Migration resource. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Optional force delete boolean. +If this is provided as true, migration will be deleted even if active. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlDbInstanceName +. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationFile.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationFile.md new file mode 100644 index 000000000000..792e95caf096 --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationFile.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationfile +schema: 2.0.0 +--- + +# Remove-AzDataMigrationFile + +## SYNOPSIS +This method deletes a file. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataMigrationFile -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationFile -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +This method deletes a file. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the File + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: FileName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationProject.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationProject.md new file mode 100644 index 000000000000..f9fb57544ebf --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationProject.md @@ -0,0 +1,248 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationproject +schema: 2.0.0 +--- + +# Remove-AzDataMigrationProject + +## SYNOPSIS +The project resource is a nested resource representing a stored migration project. +The DELETE method deletes a project. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataMigrationProject -GroupName -Name -ServiceName + [-SubscriptionId ] [-DeleteRunningTask] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationProject -InputObject [-DeleteRunningTask] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The project resource is a nested resource representing a stored migration project. +The DELETE method deletes a project. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeleteRunningTask +Delete the resource even if it contains running tasks + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the project + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ProjectName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationService.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationService.md new file mode 100644 index 000000000000..a470d90db903 --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationService.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationservice +schema: 2.0.0 +--- + +# Remove-AzDataMigrationService + +## SYNOPSIS +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. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataMigrationService -GroupName -Name [-SubscriptionId ] + [-DeleteRunningTask] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationService -InputObject [-DeleteRunningTask] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeleteRunningTask +Delete the resource even if it contains running tasks + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the service + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationServiceTask.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..e3c55ab9b51d --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationServiceTask.md @@ -0,0 +1,248 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationservicetask +schema: 2.0.0 +--- + +# Remove-AzDataMigrationServiceTask + +## SYNOPSIS +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The DELETE method deletes a service task, canceling it first if it's running. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataMigrationServiceTask -GroupName -ServiceName -TaskName + [-SubscriptionId ] [-DeleteRunningTask] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationServiceTask -InputObject [-DeleteRunningTask] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The DELETE method deletes a service task, canceling it first if it's running. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeleteRunningTask +Delete the resource even if it contains running tasks + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskName +Name of the Task + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..33268f383057 --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,247 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationsqlmigrationservice +schema: 2.0.0 +--- + +# Remove-AzDataMigrationSqlMigrationService + +## SYNOPSIS +Delete Database Migration Service. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataMigrationSqlMigrationService -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationSqlMigrationService -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete Database Migration Service. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: SqlMigrationServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationSqlMigrationServiceNode.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationSqlMigrationServiceNode.md new file mode 100644 index 000000000000..9c0128842f90 --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationSqlMigrationServiceNode.md @@ -0,0 +1,283 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationsqlmigrationservicenode +schema: 2.0.0 +--- + +# Remove-AzDataMigrationSqlMigrationServiceNode + +## SYNOPSIS +Delete the integration runtime node. + +## SYNTAX + +### DeleteExpanded (Default) +``` +Remove-AzDataMigrationSqlMigrationServiceNode -ResourceGroupName -SqlMigrationServiceName + [-SubscriptionId ] [-IntegrationRuntimeName ] [-NodeName ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Delete +``` +Remove-AzDataMigrationSqlMigrationServiceNode -ResourceGroupName -SqlMigrationServiceName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationSqlMigrationServiceNode -InputObject -Parameter + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityExpanded +``` +Remove-AzDataMigrationSqlMigrationServiceNode -InputObject + [-IntegrationRuntimeName ] [-NodeName ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Delete the integration runtime node. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity, DeleteViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IntegrationRuntimeName +The name of integration runtime. + +```yaml +Type: System.String +Parameter Sets: DeleteExpanded, DeleteViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeName +The name of node to delete. + +```yaml +Type: System.String +Parameter Sets: DeleteExpanded, DeleteViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Details of node to be deleted. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode +Parameter Sets: Delete, DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlMigrationServiceName +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : Details of node to be deleted. + - `[IntegrationRuntimeName ]`: The name of integration runtime. + - `[NodeName ]`: The name of node to delete. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Remove-AzDataMigrationTask.md b/swaggerci/datamigration/docs/Remove-AzDataMigrationTask.md new file mode 100644 index 000000000000..25ea77161964 --- /dev/null +++ b/swaggerci/datamigration/docs/Remove-AzDataMigrationTask.md @@ -0,0 +1,263 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationtask +schema: 2.0.0 +--- + +# Remove-AzDataMigrationTask + +## SYNOPSIS +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. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataMigrationTask -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-DeleteRunningTask] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataMigrationTask -InputObject [-DeleteRunningTask] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeleteRunningTask +Delete the resource even if it contains running tasks + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the Task + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: TaskName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Start-AzDataMigrationService.md b/swaggerci/datamigration/docs/Start-AzDataMigrationService.md new file mode 100644 index 000000000000..e7b5052149e2 --- /dev/null +++ b/swaggerci/datamigration/docs/Start-AzDataMigrationService.md @@ -0,0 +1,247 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/start-azdatamigrationservice +schema: 2.0.0 +--- + +# Start-AzDataMigrationService + +## SYNOPSIS +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. + +## SYNTAX + +### Start (Default) +``` +Start-AzDataMigrationService -GroupName -Name [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### StartViaIdentity +``` +Start-AzDataMigrationService -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Start +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: StartViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the service + +```yaml +Type: System.String +Parameter Sets: Start +Aliases: ServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Start +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlDb.md b/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlDb.md new file mode 100644 index 000000000000..13f36e7e4222 --- /dev/null +++ b/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlDb.md @@ -0,0 +1,313 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqldb +schema: 2.0.0 +--- + +# Stop-AzDataMigrationDatabaseMigrationsSqlDb + +## SYNOPSIS +Stop on going migration for the database. + +## SYNTAX + +### CancelExpanded (Default) +``` +Stop-AzDataMigrationDatabaseMigrationsSqlDb -ResourceGroupName -SqlDbInstanceName + -TargetDbName [-SubscriptionId ] [-MigrationOperationId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Cancel +``` +Stop-AzDataMigrationDatabaseMigrationsSqlDb -ResourceGroupName -SqlDbInstanceName + -TargetDbName -Parameter [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CancelViaIdentity +``` +Stop-AzDataMigrationDatabaseMigrationsSqlDb -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### CancelViaIdentityExpanded +``` +Stop-AzDataMigrationDatabaseMigrationsSqlDb -InputObject + [-MigrationOperationId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Stop on going migration for the database. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CancelViaIdentity, CancelViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking migration operation. + +```yaml +Type: System.String +Parameter Sets: CancelExpanded, CancelViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Migration Operation Input +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +Parameter Sets: Cancel, CancelViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlDbInstanceName +. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : Migration Operation Input + - `[MigrationOperationId ]`: ID tracking migration operation. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlMi.md b/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlMi.md new file mode 100644 index 000000000000..85d95169c6a1 --- /dev/null +++ b/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlMi.md @@ -0,0 +1,313 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqlmi +schema: 2.0.0 +--- + +# Stop-AzDataMigrationDatabaseMigrationsSqlMi + +## SYNOPSIS +Stop in-progress database migration to SQL Managed Instance. + +## SYNTAX + +### CancelExpanded (Default) +``` +Stop-AzDataMigrationDatabaseMigrationsSqlMi -ManagedInstanceName -ResourceGroupName + -TargetDbName [-SubscriptionId ] [-MigrationOperationId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Cancel +``` +Stop-AzDataMigrationDatabaseMigrationsSqlMi -ManagedInstanceName -ResourceGroupName + -TargetDbName -Parameter [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CancelViaIdentity +``` +Stop-AzDataMigrationDatabaseMigrationsSqlMi -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### CancelViaIdentityExpanded +``` +Stop-AzDataMigrationDatabaseMigrationsSqlMi -InputObject + [-MigrationOperationId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Stop in-progress database migration to SQL Managed Instance. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CancelViaIdentity, CancelViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagedInstanceName +. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking migration operation. + +```yaml +Type: System.String +Parameter Sets: CancelExpanded, CancelViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Migration Operation Input +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +Parameter Sets: Cancel, CancelViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : Migration Operation Input + - `[MigrationOperationId ]`: ID tracking migration operation. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlVM.md b/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlVM.md new file mode 100644 index 000000000000..1abc7e44e593 --- /dev/null +++ b/swaggerci/datamigration/docs/Stop-AzDataMigrationDatabaseMigrationsSqlVM.md @@ -0,0 +1,313 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqlvm +schema: 2.0.0 +--- + +# Stop-AzDataMigrationDatabaseMigrationsSqlVM + +## SYNOPSIS +Stop in-progress database migration to SQL VM. + +## SYNTAX + +### CancelExpanded (Default) +``` +Stop-AzDataMigrationDatabaseMigrationsSqlVM -ResourceGroupName -SqlVirtualMachineName + -TargetDbName [-SubscriptionId ] [-MigrationOperationId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Cancel +``` +Stop-AzDataMigrationDatabaseMigrationsSqlVM -ResourceGroupName -SqlVirtualMachineName + -TargetDbName -Parameter [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CancelViaIdentity +``` +Stop-AzDataMigrationDatabaseMigrationsSqlVM -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### CancelViaIdentityExpanded +``` +Stop-AzDataMigrationDatabaseMigrationsSqlVM -InputObject + [-MigrationOperationId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Stop in-progress database migration to SQL VM. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CancelViaIdentity, CancelViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MigrationOperationId +ID tracking migration operation. + +```yaml +Type: System.String +Parameter Sets: CancelExpanded, CancelViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Migration Operation Input +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +Parameter Sets: Cancel, CancelViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SqlVirtualMachineName +. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDbName +The name of the target database. + +```yaml +Type: System.String +Parameter Sets: Cancel, CancelExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : Migration Operation Input + - `[MigrationOperationId ]`: ID tracking migration operation. + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Stop-AzDataMigrationService.md b/swaggerci/datamigration/docs/Stop-AzDataMigrationService.md new file mode 100644 index 000000000000..a1b6bdbdaffc --- /dev/null +++ b/swaggerci/datamigration/docs/Stop-AzDataMigrationService.md @@ -0,0 +1,249 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationservice +schema: 2.0.0 +--- + +# Stop-AzDataMigrationService + +## SYNOPSIS +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. + +## SYNTAX + +### Stop (Default) +``` +Stop-AzDataMigrationService -GroupName -Name [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### StopViaIdentity +``` +Stop-AzDataMigrationService -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Stop +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: StopViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the service + +```yaml +Type: System.String +Parameter Sets: Stop +Aliases: ServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Stop +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Stop-AzDataMigrationServiceTask.md b/swaggerci/datamigration/docs/Stop-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..c572cc2b4b68 --- /dev/null +++ b/swaggerci/datamigration/docs/Stop-AzDataMigrationServiceTask.md @@ -0,0 +1,217 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationservicetask +schema: 2.0.0 +--- + +# Stop-AzDataMigrationServiceTask + +## SYNOPSIS +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method cancels a service task if it's currently queued or running. + +## SYNTAX + +### Cancel (Default) +``` +Stop-AzDataMigrationServiceTask -GroupName -ServiceName -TaskName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CancelViaIdentity +``` +Stop-AzDataMigrationServiceTask -InputObject [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method cancels a service task if it's currently queued or running. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CancelViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskName +Name of the Task + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Stop-AzDataMigrationTask.md b/swaggerci/datamigration/docs/Stop-AzDataMigrationTask.md new file mode 100644 index 000000000000..51897b7017e9 --- /dev/null +++ b/swaggerci/datamigration/docs/Stop-AzDataMigrationTask.md @@ -0,0 +1,232 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationtask +schema: 2.0.0 +--- + +# Stop-AzDataMigrationTask + +## SYNOPSIS +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. + +## SYNTAX + +### Cancel (Default) +``` +Stop-AzDataMigrationTask -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CancelViaIdentity +``` +Stop-AzDataMigrationTask -InputObject [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CancelViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the Task + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: TaskName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Cancel +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Test-AzDataMigrationServiceChildNameAvailability.md b/swaggerci/datamigration/docs/Test-AzDataMigrationServiceChildNameAvailability.md new file mode 100644 index 000000000000..2d95078afc7a --- /dev/null +++ b/swaggerci/datamigration/docs/Test-AzDataMigrationServiceChildNameAvailability.md @@ -0,0 +1,267 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicechildnameavailability +schema: 2.0.0 +--- + +# Test-AzDataMigrationServiceChildNameAvailability + +## SYNOPSIS +This method checks whether a proposed nested resource name is valid and available. + +## SYNTAX + +### CheckExpanded (Default) +``` +Test-AzDataMigrationServiceChildNameAvailability -GroupName -ServiceName + [-SubscriptionId ] [-Name ] [-Type ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### Check +``` +Test-AzDataMigrationServiceChildNameAvailability -GroupName -ServiceName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### CheckViaIdentity +``` +Test-AzDataMigrationServiceChildNameAvailability -InputObject + -Parameter [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CheckViaIdentityExpanded +``` +Test-AzDataMigrationServiceChildNameAvailability -InputObject [-Name ] + [-Type ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +This method checks whether a proposed nested resource name is valid and available. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Check, CheckExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CheckViaIdentity, CheckViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The proposed resource name + +```yaml +Type: System.String +Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +A resource type and proposed name +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest +Parameter Sets: Check, CheckViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Check, CheckExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Check, CheckExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The resource type chain (e.g. +virtualMachines/extensions) + +```yaml +Type: System.String +Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : A resource type and proposed name + - `[Name ]`: The proposed resource name + - `[Type ]`: The resource type chain (e.g. virtualMachines/extensions) + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Test-AzDataMigrationServiceNameAvailability.md b/swaggerci/datamigration/docs/Test-AzDataMigrationServiceNameAvailability.md new file mode 100644 index 000000000000..5747d82e1153 --- /dev/null +++ b/swaggerci/datamigration/docs/Test-AzDataMigrationServiceNameAvailability.md @@ -0,0 +1,250 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicenameavailability +schema: 2.0.0 +--- + +# Test-AzDataMigrationServiceNameAvailability + +## SYNOPSIS +This method checks whether a proposed top-level resource name is valid and available. + +## SYNTAX + +### CheckExpanded (Default) +``` +Test-AzDataMigrationServiceNameAvailability -Location [-SubscriptionId ] [-Name ] + [-Type ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Check +``` +Test-AzDataMigrationServiceNameAvailability -Location -Parameter + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CheckViaIdentity +``` +Test-AzDataMigrationServiceNameAvailability -InputObject + -Parameter [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CheckViaIdentityExpanded +``` +Test-AzDataMigrationServiceNameAvailability -InputObject [-Name ] + [-Type ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +This method checks whether a proposed top-level resource name is valid and available. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CheckViaIdentity, CheckViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The Azure region of the operation + +```yaml +Type: System.String +Parameter Sets: Check, CheckExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The proposed resource name + +```yaml +Type: System.String +Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +A resource type and proposed name +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest +Parameter Sets: Check, CheckViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Check, CheckExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The resource type chain (e.g. +virtualMachines/extensions) + +```yaml +Type: System.String +Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +PARAMETER : A resource type and proposed name + - `[Name ]`: The proposed resource name + - `[Type ]`: The resource type chain (e.g. virtualMachines/extensions) + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Test-AzDataMigrationServiceStatus.md b/swaggerci/datamigration/docs/Test-AzDataMigrationServiceStatus.md new file mode 100644 index 000000000000..6468d018f471 --- /dev/null +++ b/swaggerci/datamigration/docs/Test-AzDataMigrationServiceStatus.md @@ -0,0 +1,202 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicestatus +schema: 2.0.0 +--- + +# Test-AzDataMigrationServiceStatus + +## SYNOPSIS +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. + +## SYNTAX + +### Check (Default) +``` +Test-AzDataMigrationServiceStatus -GroupName -ServiceName [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CheckViaIdentity +``` +Test-AzDataMigrationServiceStatus -InputObject [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: Check +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: CheckViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: Check +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: Check +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Update-AzDataMigrationFile.md b/swaggerci/datamigration/docs/Update-AzDataMigrationFile.md new file mode 100644 index 000000000000..856191cd983c --- /dev/null +++ b/swaggerci/datamigration/docs/Update-AzDataMigrationFile.md @@ -0,0 +1,296 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationfile +schema: 2.0.0 +--- + +# Update-AzDataMigrationFile + +## SYNOPSIS +This method updates an existing file. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataMigrationFile -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-Etag ] [-Extension ] [-FilePath ] [-MediaType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataMigrationFile -InputObject [-Etag ] [-Extension ] + [-FilePath ] [-MediaType ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +This method updates an existing file. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Extension +Optional File extension. +If submitted it should not have a leading period and must match the extension from filePath. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilePath +Relative path of this file resource. +This property can be set when creating or updating the file resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MediaType +File content type. +This property can be modified to reflect the file content type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the File + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: FileName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Update-AzDataMigrationProject.md b/swaggerci/datamigration/docs/Update-AzDataMigrationProject.md new file mode 100644 index 000000000000..4a59eca84151 --- /dev/null +++ b/swaggerci/datamigration/docs/Update-AzDataMigrationProject.md @@ -0,0 +1,475 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationproject +schema: 2.0.0 +--- + +# Update-AzDataMigrationProject + +## SYNOPSIS +The project resource is a nested resource representing a stored migration project. +The PATCH method updates an existing project. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataMigrationProject -GroupName -Name -ServiceName + [-SubscriptionId ] [-AzureAuthenticationInfoAppKey ] + [-AzureAuthenticationInfoApplicationId ] [-AzureAuthenticationInfoIgnoreAzurePermission] + [-AzureAuthenticationInfoTenantId ] [-DatabasesInfo ] [-Etag ] + [-Location ] [-SourceConnectionInfoPassword ] [-SourceConnectionInfoType ] + [-SourceConnectionInfoUserName ] [-SourcePlatform ] [-Tag ] + [-TargetConnectionInfoPassword ] [-TargetConnectionInfoType ] + [-TargetConnectionInfoUserName ] [-TargetPlatform ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataMigrationProject -InputObject [-AzureAuthenticationInfoAppKey ] + [-AzureAuthenticationInfoApplicationId ] [-AzureAuthenticationInfoIgnoreAzurePermission] + [-AzureAuthenticationInfoTenantId ] [-DatabasesInfo ] [-Etag ] + [-Location ] [-SourceConnectionInfoPassword ] [-SourceConnectionInfoType ] + [-SourceConnectionInfoUserName ] [-SourcePlatform ] [-Tag ] + [-TargetConnectionInfoPassword ] [-TargetConnectionInfoType ] + [-TargetConnectionInfoUserName ] [-TargetPlatform ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The project resource is a nested resource representing a stored migration project. +The PATCH method updates an existing project. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AzureAuthenticationInfoAppKey +Key used to authenticate to the Azure Active Directory Application + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureAuthenticationInfoApplicationId +Application ID of the Azure Active Directory Application + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureAuthenticationInfoIgnoreAzurePermission +Ignore checking azure permissions on the AAD app + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureAuthenticationInfoTenantId +Tenant id of the customer + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatabasesInfo +List of DatabaseInfo +To construct, see NOTES section for DATABASESINFO properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the project + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: ProjectName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceConnectionInfoPassword +Password credential. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceConnectionInfoType +Type of connection info + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceConnectionInfoUserName +User name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourcePlatform +Source platform for the project + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Dictionary of \ + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetConnectionInfoPassword +Password credential. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetConnectionInfoType +Type of connection info + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetConnectionInfoUserName +User name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetPlatform +Target platform for the project + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +DATABASESINFO : List of DatabaseInfo + - `SourceDatabaseName `: Name of the database + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Update-AzDataMigrationService.md b/swaggerci/datamigration/docs/Update-AzDataMigrationService.md new file mode 100644 index 000000000000..48b8f08dc597 --- /dev/null +++ b/swaggerci/datamigration/docs/Update-AzDataMigrationService.md @@ -0,0 +1,457 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationservice +schema: 2.0.0 +--- + +# Update-AzDataMigrationService + +## SYNOPSIS +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\"). + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataMigrationService -GroupName -Name [-SubscriptionId ] + [-AutoStopDelay ] [-DeleteResourcesOnStop] [-Etag ] [-Kind ] [-Location ] + [-PublicKey ] [-SkuCapacity ] [-SkuFamily ] [-SkuName ] [-SkuSize ] + [-SkuTier ] [-Tag ] [-VirtualNicId ] [-VirtualSubnetId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataMigrationService -InputObject [-AutoStopDelay ] + [-DeleteResourcesOnStop] [-Etag ] [-Kind ] [-Location ] [-PublicKey ] + [-SkuCapacity ] [-SkuFamily ] [-SkuName ] [-SkuSize ] [-SkuTier ] + [-Tag ] [-VirtualNicId ] [-VirtualSubnetId ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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\"). + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoStopDelay +The time delay before the service is auto-stopped when idle. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeleteResourcesOnStop +Whether service resources should be deleted when stopped. +(Turned on by default) + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +Ignored if submitted + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Kind +The resource kind. +Only 'vm' (the default) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the service + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: ServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicKey +The public key of the service, used to encrypt secrets sent to the service + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuCapacity +The capacity of the SKU, if it supports scaling + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuFamily +The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. +for virtual machines + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The unique name of the SKU, such as 'P3' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuSize +The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. +'A1' for virtual machines + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuTier +The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Dictionary of \ + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VirtualNicId +The ID of the Microsoft.Network/networkInterfaces resource which the service have + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VirtualSubnetId +The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Update-AzDataMigrationServiceTask.md b/swaggerci/datamigration/docs/Update-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..c02422e661f9 --- /dev/null +++ b/swaggerci/datamigration/docs/Update-AzDataMigrationServiceTask.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationservicetask +schema: 2.0.0 +--- + +# Update-AzDataMigrationServiceTask + +## SYNOPSIS +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataMigrationServiceTask -GroupName -ServiceName -TaskName + [-SubscriptionId ] [-ClientData ] [-Etag ] [-TaskType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataMigrationServiceTask -InputObject [-ClientData ] + [-Etag ] [-TaskType ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ClientData +Key value pairs of client data to attach meta data information to task + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskName +Name of the Task + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskType +Task type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Update-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/docs/Update-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..63a5227f803d --- /dev/null +++ b/swaggerci/datamigration/docs/Update-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,262 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationsqlmigrationservice +schema: 2.0.0 +--- + +# Update-AzDataMigrationSqlMigrationService + +## SYNOPSIS +Update Database Migration Service. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataMigrationSqlMigrationService -Name -ResourceGroupName + [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataMigrationSqlMigrationService -InputObject [-Tag ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update Database Migration Service. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the SQL Migration Service. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: SqlMigrationServiceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the resource group that contains the resource. +You can obtain this value from the Azure Resource Manager API or the portal. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Dictionary of \ + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/docs/Update-AzDataMigrationTask.md b/swaggerci/datamigration/docs/Update-AzDataMigrationTask.md new file mode 100644 index 000000000000..f80effeaa70a --- /dev/null +++ b/swaggerci/datamigration/docs/Update-AzDataMigrationTask.md @@ -0,0 +1,279 @@ +--- +external help file: +Module Name: Az.DataMigration +online version: https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationtask +schema: 2.0.0 +--- + +# Update-AzDataMigrationTask + +## SYNOPSIS +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. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataMigrationTask -GroupName -Name -ProjectName -ServiceName + [-SubscriptionId ] [-ClientData ] [-Etag ] [-TaskType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataMigrationTask -InputObject [-ClientData ] [-Etag ] + [-TaskType ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ClientData +Key value pairs of client data to attach meta data information to task + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +HTTP strong entity tag value. +This is ignored if submitted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Name of the resource group + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the Task + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: TaskName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +Name of the project + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceName +Name of the service + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription ID that identifies an Azure subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TaskType +Task type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[FileName ]`: Name of the File + - `[GroupName ]`: Name of the resource group + - `[Id ]`: Resource identity path + - `[Location ]`: The Azure region of the operation + - `[ManagedInstanceName ]`: + - `[ProjectName ]`: Name of the project + - `[ResourceGroupName ]`: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + - `[ServiceName ]`: Name of the service + - `[SqlDbInstanceName ]`: + - `[SqlMigrationServiceName ]`: Name of the SQL Migration Service. + - `[SqlVirtualMachineName ]`: + - `[SubscriptionId ]`: Subscription ID that identifies an Azure subscription. + - `[TargetDbName ]`: The name of the target database. + - `[TaskName ]`: Name of the Task + +## RELATED LINKS + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlDb.md b/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlDb.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlDb.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlMi.md b/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlMi.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlMi.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlVM.md b/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlVM.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationDatabaseMigrationsSqlVM.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationFile.md b/swaggerci/datamigration/examples/Get-AzDataMigrationFile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationFile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationProject.md b/swaggerci/datamigration/examples/Get-AzDataMigrationProject.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationProject.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationResourceSku.md b/swaggerci/datamigration/examples/Get-AzDataMigrationResourceSku.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationResourceSku.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationService.md b/swaggerci/datamigration/examples/Get-AzDataMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationServiceSku.md b/swaggerci/datamigration/examples/Get-AzDataMigrationServiceSku.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationServiceSku.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationServiceTask.md b/swaggerci/datamigration/examples/Get-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationServiceTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceAuthKey.md b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceAuthKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceAuthKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceMigration.md b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceMigration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceMigration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceMonitoringData.md b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceMonitoringData.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationSqlMigrationServiceMonitoringData.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationTask.md b/swaggerci/datamigration/examples/Get-AzDataMigrationTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Get-AzDataMigrationUsage.md b/swaggerci/datamigration/examples/Get-AzDataMigrationUsage.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Get-AzDataMigrationUsage.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Invoke-AzDataMigrationCommandTask.md b/swaggerci/datamigration/examples/Invoke-AzDataMigrationCommandTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Invoke-AzDataMigrationCommandTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.md b/swaggerci/datamigration/examples/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.md b/swaggerci/datamigration/examples/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlDb.md b/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlDb.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlDb.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlMi.md b/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlMi.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlMi.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlVM.md b/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlVM.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationDatabaseMigrationSqlVM.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationFile.md b/swaggerci/datamigration/examples/New-AzDataMigrationFile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationFile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationProject.md b/swaggerci/datamigration/examples/New-AzDataMigrationProject.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationProject.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationService.md b/swaggerci/datamigration/examples/New-AzDataMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationServiceTask.md b/swaggerci/datamigration/examples/New-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationServiceTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/examples/New-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationSqlMigrationServiceAuthKey.md b/swaggerci/datamigration/examples/New-AzDataMigrationSqlMigrationServiceAuthKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationSqlMigrationServiceAuthKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/New-AzDataMigrationTask.md b/swaggerci/datamigration/examples/New-AzDataMigrationTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/New-AzDataMigrationTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Read-AzDataMigrationFile.md b/swaggerci/datamigration/examples/Read-AzDataMigrationFile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Read-AzDataMigrationFile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Read-AzDataMigrationFileWrite.md b/swaggerci/datamigration/examples/Read-AzDataMigrationFileWrite.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Read-AzDataMigrationFileWrite.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationDatabaseMigrationsSqlDb.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationDatabaseMigrationsSqlDb.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationDatabaseMigrationsSqlDb.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationFile.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationFile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationFile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationProject.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationProject.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationProject.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationService.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationServiceTask.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationServiceTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationSqlMigrationServiceNode.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationSqlMigrationServiceNode.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationSqlMigrationServiceNode.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Remove-AzDataMigrationTask.md b/swaggerci/datamigration/examples/Remove-AzDataMigrationTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Remove-AzDataMigrationTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Start-AzDataMigrationService.md b/swaggerci/datamigration/examples/Start-AzDataMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Start-AzDataMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlDb.md b/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlDb.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlDb.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlMi.md b/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlMi.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlMi.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlVM.md b/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlVM.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Stop-AzDataMigrationDatabaseMigrationsSqlVM.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Stop-AzDataMigrationService.md b/swaggerci/datamigration/examples/Stop-AzDataMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Stop-AzDataMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Stop-AzDataMigrationServiceTask.md b/swaggerci/datamigration/examples/Stop-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Stop-AzDataMigrationServiceTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Stop-AzDataMigrationTask.md b/swaggerci/datamigration/examples/Stop-AzDataMigrationTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Stop-AzDataMigrationTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Test-AzDataMigrationServiceChildNameAvailability.md b/swaggerci/datamigration/examples/Test-AzDataMigrationServiceChildNameAvailability.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Test-AzDataMigrationServiceChildNameAvailability.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Test-AzDataMigrationServiceNameAvailability.md b/swaggerci/datamigration/examples/Test-AzDataMigrationServiceNameAvailability.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Test-AzDataMigrationServiceNameAvailability.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Test-AzDataMigrationServiceStatus.md b/swaggerci/datamigration/examples/Test-AzDataMigrationServiceStatus.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Test-AzDataMigrationServiceStatus.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Update-AzDataMigrationFile.md b/swaggerci/datamigration/examples/Update-AzDataMigrationFile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Update-AzDataMigrationFile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Update-AzDataMigrationProject.md b/swaggerci/datamigration/examples/Update-AzDataMigrationProject.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Update-AzDataMigrationProject.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Update-AzDataMigrationService.md b/swaggerci/datamigration/examples/Update-AzDataMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Update-AzDataMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Update-AzDataMigrationServiceTask.md b/swaggerci/datamigration/examples/Update-AzDataMigrationServiceTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Update-AzDataMigrationServiceTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Update-AzDataMigrationSqlMigrationService.md b/swaggerci/datamigration/examples/Update-AzDataMigrationSqlMigrationService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Update-AzDataMigrationSqlMigrationService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/examples/Update-AzDataMigrationTask.md b/swaggerci/datamigration/examples/Update-AzDataMigrationTask.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/datamigration/examples/Update-AzDataMigrationTask.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/datamigration/export-surface.ps1 b/swaggerci/datamigration/export-surface.ps1 new file mode 100644 index 000000000000..0f46809dc9e8 --- /dev/null +++ b/swaggerci/datamigration/export-surface.ps1 @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.DataMigration.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.DataMigration' +$exportsFolder = Join-Path $PSScriptRoot 'exports' +$resourcesFolder = Join-Path $PSScriptRoot 'resources' + +Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'" + +Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'" + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlDb.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlDb.ps1 new file mode 100644 index 000000000000..40b98cb7f354 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlDb.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the Database Migration resource. +.Description +Retrieve the Database Migration resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqldb +#> +function Get-AzDataMigrationDatabaseMigrationsSqlDb { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Complete migration details be included in the response. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # 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. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlDb_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlMi.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlMi.ps1 new file mode 100644 index 000000000000..d6f908943db9 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlMi.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the specified database migration for a given SQL Managed Instance. +.Description +Retrieve the specified database migration for a given SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqlmi +#> +function Get-AzDataMigrationDatabaseMigrationsSqlMi { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Complete migration details be included in the response. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # 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. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlMi_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlVM.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlVM.ps1 new file mode 100644 index 000000000000..c52092014ce5 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationDatabaseMigrationsSqlVM.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the specified database migration for a given SQL VM. +.Description +Retrieve the specified database migration for a given SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqlvm +#> +function Get-AzDataMigrationDatabaseMigrationsSqlVM { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Complete migration details be included in the response. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # 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. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlVM_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationFile.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationFile.ps1 new file mode 100644 index 000000000000..0f9344e0c797 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationFile.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The files resource is a nested, proxy-only resource representing a file stored under the project resource. +This method retrieves information about a file. +.Description +The files resource is a nested, proxy-only resource representing a file stored under the project resource. +This method retrieves information about a file. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationfile +#> +function Get-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationFile_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationFile_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationFile_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationProject.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationProject.ps1 new file mode 100644 index 000000000000..2f50018d46d7 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationProject.ps1 @@ -0,0 +1,213 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The GET method retrieves information about a project. +.Description +The project resource is a nested resource representing a stored migration project. +The GET method retrieves information about a project. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationproject +#> +function Get-AzDataMigrationProject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationProject_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationProject_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationProject_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationResourceSku.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationResourceSku.ps1 new file mode 100644 index 000000000000..980135b912fe --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationResourceSku.ps1 @@ -0,0 +1,158 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The skus action returns the list of SKUs that DMS supports. +.Description +The skus action returns the list of SKUs that DMS supports. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationresourcesku +#> +function Get-AzDataMigrationResourceSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationResourceSku_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationService.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationService.ps1 new file mode 100644 index 000000000000..eac8cf4351b2 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationService.ps1 @@ -0,0 +1,208 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The services resource is the top-level resource that represents the Database Migration Service. +The GET method retrieves information about a service instance. +.Description +The services resource is the top-level resource that represents the Database Migration Service. +The GET method retrieves information about a service instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservice +#> +function Get-AzDataMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationService_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationService_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationService_List'; + List1 = 'Az.DataMigration.private\Get-AzDataMigrationService_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationServiceSku.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationServiceSku.ps1 new file mode 100644 index 000000000000..22ef3ba23763 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationServiceSku.ps1 @@ -0,0 +1,172 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservicesku +#> +function Get-AzDataMigrationServiceSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationServiceSku_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationServiceTask.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationServiceTask.ps1 new file mode 100644 index 000000000000..226150e53558 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationServiceTask.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a service task. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a service task. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservicetask +#> +function Get-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Expand the response + ${Expand}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Filter tasks by task type + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationServiceTask_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationServiceTask_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationServiceTask_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationService.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationService.ps1 new file mode 100644 index 000000000000..fcc1932cbac8 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationService.ps1 @@ -0,0 +1,213 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the Database Migration Service +.Description +Retrieve the Database Migration Service +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservice +#> +function Get-AzDataMigrationSqlMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_List'; + List1 = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceAuthKey.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceAuthKey.ps1 new file mode 100644 index 000000000000..8c78e9c6db7a --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceAuthKey.ps1 @@ -0,0 +1,177 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. +.Description +Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationserviceauthkey +#> +function Get-AzDataMigrationSqlMigrationServiceAuthKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationServiceAuthKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceMigration.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceMigration.ps1 new file mode 100644 index 000000000000..dd35c7a35b34 --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceMigration.ps1 @@ -0,0 +1,177 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the List of database migrations attached to the service. +.Description +Retrieve the List of database migrations attached to the service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservicemigration +#> +function Get-AzDataMigrationSqlMigrationServiceMigration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationServiceMigration_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceMonitoringData.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceMonitoringData.ps1 new file mode 100644 index 000000000000..f25ec2041b3b --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationSqlMigrationServiceMonitoringData.ps1 @@ -0,0 +1,177 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. +.Description +Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservicemonitoringdata +#> +function Get-AzDataMigrationSqlMigrationServiceMonitoringData { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationServiceMonitoringData_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationTask.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationTask.ps1 new file mode 100644 index 000000000000..dafd780533eb --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationTask.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a task. +.Description +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a task. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationtask +#> +function Get-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Expand the response + ${Expand}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Filter tasks by task type + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationTask_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationTask_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationTask_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Get-AzDataMigrationUsage.ps1 b/swaggerci/datamigration/exports/Get-AzDataMigrationUsage.ps1 new file mode 100644 index 000000000000..7691fc0a812d --- /dev/null +++ b/swaggerci/datamigration/exports/Get-AzDataMigrationUsage.ps1 @@ -0,0 +1,164 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This method returns region-specific quotas and resource usage information for the Database Migration Service. +.Description +This method returns region-specific quotas and resource usage information for the Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationusage +#> +function Get-AzDataMigrationUsage { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The Azure region of the operation + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationUsage_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Invoke-AzDataMigrationCommandTask.ps1 b/swaggerci/datamigration/exports/Invoke-AzDataMigrationCommandTask.ps1 new file mode 100644 index 000000000000..a00d67646244 --- /dev/null +++ b/swaggerci/datamigration/exports/Invoke-AzDataMigrationCommandTask.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method executes a command on a running task. +.Description +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method executes a command on a running task. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + CommandType : Command type. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcommandtask +#> +function Invoke-AzDataMigrationCommandTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties])] +[CmdletBinding(DefaultParameterSetName='CommandExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Command')] + [Parameter(ParameterSetName='CommandExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='CommandViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CommandViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Command', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CommandViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties] + # Base class for all types of DMS command properties. + # If command is not supported by current client, this object is returned. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Parameter(ParameterSetName='CommandViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType] + # Command type. + ${CommandType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Command = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_Command'; + CommandExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_CommandExpanded'; + CommandViaIdentity = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_CommandViaIdentity'; + CommandViaIdentityExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_CommandViaIdentityExpanded'; + } + if (('Command', 'CommandExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.ps1 b/swaggerci/datamigration/exports/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.ps1 new file mode 100644 index 000000000000..3ab124c94f23 --- /dev/null +++ b/swaggerci/datamigration/exports/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.ps1 @@ -0,0 +1,252 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Initiate cutover for in-progress online database migration to SQL Managed Instance. +.Description +Initiate cutover for in-progress online database migration to SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcutoverdatabasemigrationsqlmi +#> +function Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CutoverExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cutover')] + [Parameter(ParameterSetName='CutoverExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cutover', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CutoverExpanded')] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cutover = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover'; + CutoverExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded'; + CutoverViaIdentity = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity'; + CutoverViaIdentityExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded'; + } + if (('Cutover', 'CutoverExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.ps1 b/swaggerci/datamigration/exports/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.ps1 new file mode 100644 index 000000000000..a5b6be92e2dc --- /dev/null +++ b/swaggerci/datamigration/exports/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.ps1 @@ -0,0 +1,252 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Initiate cutover for in-progress online database migration to SQL VM. +.Description +Initiate cutover for in-progress online database migration to SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcutoverdatabasemigrationsqlvm +#> +function Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CutoverExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(ParameterSetName='Cutover')] + [Parameter(ParameterSetName='CutoverExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cutover', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CutoverExpanded')] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cutover = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover'; + CutoverExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded'; + CutoverViaIdentity = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity'; + CutoverViaIdentityExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded'; + } + if (('Cutover', 'CutoverExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlDb.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlDb.ps1 new file mode 100644 index 000000000000..b0cf098a0e24 --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlDb.ps1 @@ -0,0 +1,317 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create or Update Database Migration resource. +.Description +Create or Update Database Migration resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqldb +#> +function New-AzDataMigrationDatabaseMigrationSqlDb { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType] + # . + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking current migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the Migration Service. + ${MigrationService}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Error message for migration provisioning failure, if any. + ${ProvisioningError}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the target resource (SQL VM or SQL Managed Instance). + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Name of the source database. + ${SourceDatabaseName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${SourceSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${SourceSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${SourceSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${SourceSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${SourceSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${SourceSqlConnectionUserName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String[]] + # List of tables to copy. + ${TableList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Database collation to be used for the target database. + ${TargetDatabaseCollation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${TargetSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${TargetSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${TargetSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${TargetSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${TargetSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${TargetSqlConnectionUserName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationDatabaseMigrationSqlDb_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlMi.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlMi.ps1 new file mode 100644 index 000000000000..c103a060ac3d --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlMi.ps1 @@ -0,0 +1,336 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a new database migration to a given SQL Managed Instance. +.Description +Create a new database migration to a given SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqlmi +#> +function New-AzDataMigrationDatabaseMigrationSqlMi { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${AzureBlobAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Blob container name where backups are stored. + ${AzureBlobContainerName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account where backups are stored. + ${AzureBlobStorageAccountResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password for username to access file share location. + ${FileSharePassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Location as SMB share or local drive where backups are placed. + ${FileSharePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Username to access the file share location for backups. + ${FileShareUsername}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType] + # . + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking current migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the Migration Service. + ${MigrationService}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # 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. + ${OfflineConfigurationLastBackupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Offline migration + ${OfflineConfigurationOffline}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Error message for migration provisioning failure, if any. + ${ProvisioningError}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the target resource (SQL VM or SQL Managed Instance). + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Name of the source database. + ${SourceDatabaseName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${SourceSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${SourceSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${SourceSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${SourceSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${SourceSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${SourceSqlConnectionUserName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Database collation to be used for the target database. + ${TargetDatabaseCollation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${TargetLocationAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account copying backups. + ${TargetLocationStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationDatabaseMigrationSqlMi_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlVM.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlVM.ps1 new file mode 100644 index 000000000000..b2951d989ea8 --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationDatabaseMigrationSqlVM.ps1 @@ -0,0 +1,336 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a new database migration to a given SQL VM. +.Description +Create a new database migration to a given SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqlvm +#> +function New-AzDataMigrationDatabaseMigrationSqlVM { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${AzureBlobAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Blob container name where backups are stored. + ${AzureBlobContainerName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account where backups are stored. + ${AzureBlobStorageAccountResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password for username to access file share location. + ${FileSharePassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Location as SMB share or local drive where backups are placed. + ${FileSharePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Username to access the file share location for backups. + ${FileShareUsername}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType] + # . + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking current migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the Migration Service. + ${MigrationService}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # 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. + ${OfflineConfigurationLastBackupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Offline migration + ${OfflineConfigurationOffline}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Error message for migration provisioning failure, if any. + ${ProvisioningError}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the target resource (SQL VM or SQL Managed Instance). + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Name of the source database. + ${SourceDatabaseName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${SourceSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${SourceSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${SourceSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${SourceSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${SourceSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${SourceSqlConnectionUserName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Database collation to be used for the target database. + ${TargetDatabaseCollation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${TargetLocationAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account copying backups. + ${TargetLocationStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationDatabaseMigrationSqlVM_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationFile.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationFile.ps1 new file mode 100644 index 000000000000..51297c40fae5 --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationFile.ps1 @@ -0,0 +1,211 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The PUT method creates a new file or updates an existing one. +.Description +The PUT method creates a new file or updates an existing one. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationfile +#> +function New-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Optional File extension. + # If submitted it should not have a leading period and must match the extension from filePath. + ${Extension}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Relative path of this file resource. + # This property can be set when creating or updating the file resource. + ${FilePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # File content type. + # This property can be modified to reflect the file content type. + ${MediaType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationFile_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationProject.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationProject.ps1 new file mode 100644 index 000000000000..9b184b5f95ed --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationProject.ps1 @@ -0,0 +1,288 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The PUT method creates a new project or updates an existing one. +.Description +The project resource is a nested resource representing a stored migration project. +The PUT method creates a new project or updates an existing one. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DATABASESINFO : List of DatabaseInfo + SourceDatabaseName : Name of the database +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationproject +#> +function New-AzDataMigrationProject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Key used to authenticate to the Azure Active Directory Application + ${AzureAuthenticationInfoAppKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Application ID of the Azure Active Directory Application + ${AzureAuthenticationInfoApplicationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Ignore checking azure permissions on the AAD app + ${AzureAuthenticationInfoIgnoreAzurePermission}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Tenant id of the customer + ${AzureAuthenticationInfoTenantId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]] + # List of DatabaseInfo + # To construct, see NOTES section for DATABASESINFO properties and create a hash table. + ${DatabasesInfo}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${SourceConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${SourceConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${SourceConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform] + # Source platform for the project + ${SourcePlatform}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${TargetConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${TargetConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${TargetConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform] + # Target platform for the project + ${TargetPlatform}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationProject_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationService.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationService.ps1 new file mode 100644 index 000000000000..c54a69e32b28 --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationService.ps1 @@ -0,0 +1,289 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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 (\"ServiceIsBusy\"). +The provider will reply when successful with 200 OK or 201 Created. +Long-running operations use the provisioningState property. +.Description +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 (\"ServiceIsBusy\"). +The provider will reply when successful with 200 OK or 201 Created. +Long-running operations use the provisioningState property. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationservice +#> +function New-AzDataMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The time delay before the service is auto-stopped when idle. + ${AutoStopDelay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether service resources should be deleted when stopped. + # (Turned on by default) + ${DeleteResourcesOnStop}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # Ignored if submitted + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource kind. + # Only 'vm' (the default) is supported. + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The public key of the service, used to encrypt secrets sent to the service + ${PublicKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Int32] + # The capacity of the SKU, if it supports scaling + ${SkuCapacity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. + # for virtual machines + ${SkuFamily}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The unique name of the SKU, such as 'P3' + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. + # 'A1' for virtual machines + ${SkuSize}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/networkInterfaces resource which the service have + ${VirtualNicId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + ${VirtualSubnetId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationService_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationServiceTask.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationServiceTask.ps1 new file mode 100644 index 000000000000..4220769059ab --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationServiceTask.ps1 @@ -0,0 +1,199 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationservicetask +#> +function New-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationServiceTask_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationSqlMigrationService.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationSqlMigrationService.ps1 new file mode 100644 index 000000000000..4b1f2547dd3d --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationSqlMigrationService.ps1 @@ -0,0 +1,203 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create or Update Database Migration Service. +.Description +Create or Update Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationsqlmigrationservice +#> +function New-AzDataMigrationSqlMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationService_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationSqlMigrationServiceAuthKey.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationSqlMigrationServiceAuthKey.ps1 new file mode 100644 index 000000000000..9623f07e8fb0 --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationSqlMigrationServiceAuthKey.ps1 @@ -0,0 +1,249 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. +.Description +Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : An authentication key to regenerate. + [AuthKey1 ]: The first authentication key. + [AuthKey2 ]: The second authentication key. + [KeyName ]: The name of authentication key to generate. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationsqlmigrationserviceauthkey +#> +function New-AzDataMigrationSqlMigrationServiceAuthKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys] + # An authentication key to regenerate. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='RegenerateExpanded')] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The first authentication key. + ${AuthKey1}, + + [Parameter(ParameterSetName='RegenerateExpanded')] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The second authentication key. + ${AuthKey2}, + + [Parameter(ParameterSetName='RegenerateExpanded')] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The name of authentication key to generate. + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_Regenerate'; + RegenerateExpanded = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/New-AzDataMigrationTask.ps1 b/swaggerci/datamigration/exports/New-AzDataMigrationTask.ps1 new file mode 100644 index 000000000000..dec0bb3289f0 --- /dev/null +++ b/swaggerci/datamigration/exports/New-AzDataMigrationTask.ps1 @@ -0,0 +1,206 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationtask +#> +function New-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationTask_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/datamigration/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..8d9a21b79c3e --- /dev/null +++ b/swaggerci/datamigration/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,12107 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieve the Database Migration resource. +.Description +Retrieve the Database Migration resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqldb +#> +function Get-AzDataMigrationDatabaseMigrationsSqlDb { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Complete migration details be included in the response. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # 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. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlDb_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieve the specified database migration for a given SQL Managed Instance. +.Description +Retrieve the specified database migration for a given SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqlmi +#> +function Get-AzDataMigrationDatabaseMigrationsSqlMi { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Complete migration details be included in the response. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # 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. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlMi_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieve the specified database migration for a given SQL VM. +.Description +Retrieve the specified database migration for a given SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationdatabasemigrationssqlvm +#> +function Get-AzDataMigrationDatabaseMigrationsSqlVM { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Complete migration details be included in the response. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # 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. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlVM_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The files resource is a nested, proxy-only resource representing a file stored under the project resource. +This method retrieves information about a file. +.Description +The files resource is a nested, proxy-only resource representing a file stored under the project resource. +This method retrieves information about a file. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationfile +#> +function Get-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationFile_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationFile_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationFile_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The GET method retrieves information about a project. +.Description +The project resource is a nested resource representing a stored migration project. +The GET method retrieves information about a project. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationproject +#> +function Get-AzDataMigrationProject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationProject_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationProject_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationProject_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The skus action returns the list of SKUs that DMS supports. +.Description +The skus action returns the list of SKUs that DMS supports. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationresourcesku +#> +function Get-AzDataMigrationResourceSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationResourceSku_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservicesku +#> +function Get-AzDataMigrationServiceSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationServiceSku_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a service task. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a service task. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservicetask +#> +function Get-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Expand the response + ${Expand}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Filter tasks by task type + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationServiceTask_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationServiceTask_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationServiceTask_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The services resource is the top-level resource that represents the Database Migration Service. +The GET method retrieves information about a service instance. +.Description +The services resource is the top-level resource that represents the Database Migration Service. +The GET method retrieves information about a service instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationservice +#> +function Get-AzDataMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationService_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationService_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationService_List'; + List1 = 'Az.DataMigration.private\Get-AzDataMigrationService_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. +.Description +Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationserviceauthkey +#> +function Get-AzDataMigrationSqlMigrationServiceAuthKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationServiceAuthKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieve the List of database migrations attached to the service. +.Description +Retrieve the List of database migrations attached to the service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservicemigration +#> +function Get-AzDataMigrationSqlMigrationServiceMigration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationServiceMigration_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. +.Description +Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservicemonitoringdata +#> +function Get-AzDataMigrationSqlMigrationServiceMonitoringData { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationServiceMonitoringData_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieve the Database Migration Service +.Description +Retrieve the Database Migration Service +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationsqlmigrationservice +#> +function Get-AzDataMigrationSqlMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_List'; + List1 = 'Az.DataMigration.private\Get-AzDataMigrationSqlMigrationService_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a task. +.Description +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The GET method retrieves information about a task. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationtask +#> +function Get-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Expand the response + ${Expand}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.String] + # Filter tasks by task type + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.DataMigration.private\Get-AzDataMigrationTask_Get'; + GetViaIdentity = 'Az.DataMigration.private\Get-AzDataMigrationTask_GetViaIdentity'; + List = 'Az.DataMigration.private\Get-AzDataMigrationTask_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This method returns region-specific quotas and resource usage information for the Database Migration Service. +.Description +This method returns region-specific quotas and resource usage information for the Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationusage +#> +function Get-AzDataMigrationUsage { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The Azure region of the operation + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationUsage_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method executes a command on a running task. +.Description +The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method executes a command on a running task. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + CommandType : Command type. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcommandtask +#> +function Invoke-AzDataMigrationCommandTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties])] +[CmdletBinding(DefaultParameterSetName='CommandExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Command')] + [Parameter(ParameterSetName='CommandExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Command', Mandatory)] + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='CommandViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CommandViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Command', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CommandViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties] + # Base class for all types of DMS command properties. + # If command is not supported by current client, this object is returned. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CommandExpanded', Mandatory)] + [Parameter(ParameterSetName='CommandViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType] + # Command type. + ${CommandType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Command = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_Command'; + CommandExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_CommandExpanded'; + CommandViaIdentity = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_CommandViaIdentity'; + CommandViaIdentityExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCommandTask_CommandViaIdentityExpanded'; + } + if (('Command', 'CommandExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Initiate cutover for in-progress online database migration to SQL Managed Instance. +.Description +Initiate cutover for in-progress online database migration to SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcutoverdatabasemigrationsqlmi +#> +function Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CutoverExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cutover')] + [Parameter(ParameterSetName='CutoverExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cutover', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CutoverExpanded')] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cutover = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover'; + CutoverExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded'; + CutoverViaIdentity = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity'; + CutoverViaIdentityExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded'; + } + if (('Cutover', 'CutoverExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Initiate cutover for in-progress online database migration to SQL VM. +.Description +Initiate cutover for in-progress online database migration to SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/invoke-azdatamigrationcutoverdatabasemigrationsqlvm +#> +function Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CutoverExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(ParameterSetName='Cutover')] + [Parameter(ParameterSetName='CutoverExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cutover', Mandatory)] + [Parameter(ParameterSetName='CutoverExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cutover', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CutoverViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CutoverExpanded')] + [Parameter(ParameterSetName='CutoverViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cutover = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover'; + CutoverExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded'; + CutoverViaIdentity = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity'; + CutoverViaIdentityExpanded = 'Az.DataMigration.private\Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded'; + } + if (('Cutover', 'CutoverExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create or Update Database Migration resource. +.Description +Create or Update Database Migration resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqldb +#> +function New-AzDataMigrationDatabaseMigrationSqlDb { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType] + # . + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking current migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the Migration Service. + ${MigrationService}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Error message for migration provisioning failure, if any. + ${ProvisioningError}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the target resource (SQL VM or SQL Managed Instance). + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Name of the source database. + ${SourceDatabaseName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${SourceSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${SourceSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${SourceSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${SourceSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${SourceSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${SourceSqlConnectionUserName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String[]] + # List of tables to copy. + ${TableList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Database collation to be used for the target database. + ${TargetDatabaseCollation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${TargetSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${TargetSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${TargetSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${TargetSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${TargetSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${TargetSqlConnectionUserName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationDatabaseMigrationSqlDb_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create a new database migration to a given SQL Managed Instance. +.Description +Create a new database migration to a given SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqlmi +#> +function New-AzDataMigrationDatabaseMigrationSqlMi { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${AzureBlobAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Blob container name where backups are stored. + ${AzureBlobContainerName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account where backups are stored. + ${AzureBlobStorageAccountResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password for username to access file share location. + ${FileSharePassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Location as SMB share or local drive where backups are placed. + ${FileSharePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Username to access the file share location for backups. + ${FileShareUsername}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType] + # . + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking current migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the Migration Service. + ${MigrationService}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # 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. + ${OfflineConfigurationLastBackupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Offline migration + ${OfflineConfigurationOffline}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Error message for migration provisioning failure, if any. + ${ProvisioningError}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the target resource (SQL VM or SQL Managed Instance). + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Name of the source database. + ${SourceDatabaseName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${SourceSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${SourceSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${SourceSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${SourceSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${SourceSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${SourceSqlConnectionUserName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Database collation to be used for the target database. + ${TargetDatabaseCollation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${TargetLocationAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account copying backups. + ${TargetLocationStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationDatabaseMigrationSqlMi_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create a new database migration to a given SQL VM. +.Description +Create a new database migration to a given SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationdatabasemigrationsqlvm +#> +function New-AzDataMigrationDatabaseMigrationSqlVM { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${AzureBlobAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Blob container name where backups are stored. + ${AzureBlobContainerName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account where backups are stored. + ${AzureBlobStorageAccountResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password for username to access file share location. + ${FileSharePassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Location as SMB share or local drive where backups are placed. + ${FileSharePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Username to access the file share location for backups. + ${FileShareUsername}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType] + # . + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking current migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the Migration Service. + ${MigrationService}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # 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. + ${OfflineConfigurationLastBackupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Offline migration + ${OfflineConfigurationOffline}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Error message for migration provisioning failure, if any. + ${ProvisioningError}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the target resource (SQL VM or SQL Managed Instance). + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Name of the source database. + ${SourceDatabaseName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Authentication type. + ${SourceSqlConnectionAuthentication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Data source. + ${SourceSqlConnectionDataSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to encrypt connection or not. + ${SourceSqlConnectionEncryptConnection}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Security.SecureString] + # Password to connect to source SQL. + ${SourceSqlConnectionPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to trust server certificate or not. + ${SourceSqlConnectionTrustServerCertificate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name to connect to source SQL. + ${SourceSqlConnectionUserName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Database collation to be used for the target database. + ${TargetDatabaseCollation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Storage Account Key. + ${TargetLocationAccountKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Resource Id of the storage account copying backups. + ${TargetLocationStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationDatabaseMigrationSqlVM_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The PUT method creates a new file or updates an existing one. +.Description +The PUT method creates a new file or updates an existing one. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationfile +#> +function New-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Optional File extension. + # If submitted it should not have a leading period and must match the extension from filePath. + ${Extension}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Relative path of this file resource. + # This property can be set when creating or updating the file resource. + ${FilePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # File content type. + # This property can be modified to reflect the file content type. + ${MediaType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationFile_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The PUT method creates a new project or updates an existing one. +.Description +The project resource is a nested resource representing a stored migration project. +The PUT method creates a new project or updates an existing one. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DATABASESINFO : List of DatabaseInfo + SourceDatabaseName : Name of the database +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationproject +#> +function New-AzDataMigrationProject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Key used to authenticate to the Azure Active Directory Application + ${AzureAuthenticationInfoAppKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Application ID of the Azure Active Directory Application + ${AzureAuthenticationInfoApplicationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Ignore checking azure permissions on the AAD app + ${AzureAuthenticationInfoIgnoreAzurePermission}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Tenant id of the customer + ${AzureAuthenticationInfoTenantId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]] + # List of DatabaseInfo + # To construct, see NOTES section for DATABASESINFO properties and create a hash table. + ${DatabasesInfo}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${SourceConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${SourceConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${SourceConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform] + # Source platform for the project + ${SourcePlatform}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${TargetConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${TargetConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${TargetConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform] + # Target platform for the project + ${TargetPlatform}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationProject_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationservicetask +#> +function New-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationServiceTask_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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 (\"ServiceIsBusy\"). +The provider will reply when successful with 200 OK or 201 Created. +Long-running operations use the provisioningState property. +.Description +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 (\"ServiceIsBusy\"). +The provider will reply when successful with 200 OK or 201 Created. +Long-running operations use the provisioningState property. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationservice +#> +function New-AzDataMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The time delay before the service is auto-stopped when idle. + ${AutoStopDelay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether service resources should be deleted when stopped. + # (Turned on by default) + ${DeleteResourcesOnStop}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # Ignored if submitted + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource kind. + # Only 'vm' (the default) is supported. + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The public key of the service, used to encrypt secrets sent to the service + ${PublicKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Int32] + # The capacity of the SKU, if it supports scaling + ${SkuCapacity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. + # for virtual machines + ${SkuFamily}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The unique name of the SKU, such as 'P3' + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. + # 'A1' for virtual machines + ${SkuSize}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/networkInterfaces resource which the service have + ${VirtualNicId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + ${VirtualSubnetId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationService_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. +.Description +Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : An authentication key to regenerate. + [AuthKey1 ]: The first authentication key. + [AuthKey2 ]: The second authentication key. + [KeyName ]: The name of authentication key to generate. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationsqlmigrationserviceauthkey +#> +function New-AzDataMigrationSqlMigrationServiceAuthKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys] + # An authentication key to regenerate. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='RegenerateExpanded')] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The first authentication key. + ${AuthKey1}, + + [Parameter(ParameterSetName='RegenerateExpanded')] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The second authentication key. + ${AuthKey2}, + + [Parameter(ParameterSetName='RegenerateExpanded')] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The name of authentication key to generate. + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_Regenerate'; + RegenerateExpanded = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create or Update Database Migration Service. +.Description +Create or Update Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationsqlmigrationservice +#> +function New-AzDataMigrationSqlMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationSqlMigrationService_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/new-azdatamigrationtask +#> +function New-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.DataMigration.private\New-AzDataMigrationTask_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This method is used for requesting information for reading and writing the file content. +.Description +This method is used for requesting information for reading and writing the file content. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/read-azdatamigrationfilewrite +#> +function Read-AzDataMigrationFileWrite { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo])] +[CmdletBinding(DefaultParameterSetName='Read', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${FileName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Read')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ReadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Read = 'Az.DataMigration.private\Read-AzDataMigrationFileWrite_Read'; + ReadViaIdentity = 'Az.DataMigration.private\Read-AzDataMigrationFileWrite_ReadViaIdentity'; + } + if (('Read') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This method is used for requesting storage information using which contents of the file can be downloaded. +.Description +This method is used for requesting storage information using which contents of the file can be downloaded. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/read-azdatamigrationfile +#> +function Read-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo])] +[CmdletBinding(DefaultParameterSetName='Read', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Read')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ReadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Read = 'Az.DataMigration.private\Read-AzDataMigrationFile_Read'; + ReadViaIdentity = 'Az.DataMigration.private\Read-AzDataMigrationFile_ReadViaIdentity'; + } + if (('Read') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete Database Migration resource. +.Description +Delete Database Migration resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationdatabasemigrationssqldb +#> +function Remove-AzDataMigrationDatabaseMigrationsSqlDb { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Optional force delete boolean. + # If this is provided as true, migration will be deleted even if active. + ${Force}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationDatabaseMigrationsSqlDb_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This method deletes a file. +.Description +This method deletes a file. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationfile +#> +function Remove-AzDataMigrationFile { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationFile_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationFile_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The DELETE method deletes a project. +.Description +The project resource is a nested resource representing a stored migration project. +The DELETE method deletes a project. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationproject +#> +function Remove-AzDataMigrationProject { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationProject_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationProject_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The DELETE method deletes a service task, canceling it first if it's running. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The DELETE method deletes a service task, canceling it first if it's running. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationservicetask +#> +function Remove-AzDataMigrationServiceTask { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationServiceTask_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationServiceTask_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationservice +#> +function Remove-AzDataMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationService_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationService_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete the integration runtime node. +.Description +Delete the integration runtime node. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Details of node to be deleted. + [IntegrationRuntimeName ]: The name of integration runtime. + [NodeName ]: The name of node to delete. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationsqlmigrationservicenode +#> +function Remove-AzDataMigrationSqlMigrationServiceNode { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode])] +[CmdletBinding(DefaultParameterSetName='DeleteExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='DeleteExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Delete', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode] + # Details of node to be deleted. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='DeleteExpanded')] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The name of integration runtime. + ${IntegrationRuntimeName}, + + [Parameter(ParameterSetName='DeleteExpanded')] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The name of node to delete. + ${NodeName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_Delete'; + DeleteExpanded = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_DeleteExpanded'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity'; + DeleteViaIdentityExpanded = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded'; + } + if (('Delete', 'DeleteExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete Database Migration Service. +.Description +Delete Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationsqlmigrationservice +#> +function Remove-AzDataMigrationSqlMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationService_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationService_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationtask +#> +function Remove-AzDataMigrationTask { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationTask_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationTask_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/start-azdatamigrationservice +#> +function Start-AzDataMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Start', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Start', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Start', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Start')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StartViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Start = 'Az.DataMigration.private\Start-AzDataMigrationService_Start'; + StartViaIdentity = 'Az.DataMigration.private\Start-AzDataMigrationService_StartViaIdentity'; + } + if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Stop on going migration for the database. +.Description +Stop on going migration for the database. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqldb +#> +function Stop-AzDataMigrationDatabaseMigrationsSqlDb { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CancelExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(ParameterSetName='Cancel')] + [Parameter(ParameterSetName='CancelExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cancel', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CancelExpanded')] + [Parameter(ParameterSetName='CancelViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_Cancel'; + CancelExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity'; + CancelViaIdentityExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded'; + } + if (('Cancel', 'CancelExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Stop in-progress database migration to SQL Managed Instance. +.Description +Stop in-progress database migration to SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqlmi +#> +function Stop-AzDataMigrationDatabaseMigrationsSqlMi { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CancelExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cancel')] + [Parameter(ParameterSetName='CancelExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cancel', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CancelExpanded')] + [Parameter(ParameterSetName='CancelViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_Cancel'; + CancelExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity'; + CancelViaIdentityExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded'; + } + if (('Cancel', 'CancelExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Stop in-progress database migration to SQL VM. +.Description +Stop in-progress database migration to SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqlvm +#> +function Stop-AzDataMigrationDatabaseMigrationsSqlVM { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CancelExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(ParameterSetName='Cancel')] + [Parameter(ParameterSetName='CancelExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cancel', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CancelExpanded')] + [Parameter(ParameterSetName='CancelViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_Cancel'; + CancelExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity'; + CancelViaIdentityExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded'; + } + if (('Cancel', 'CancelExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method cancels a service task if it's currently queued or running. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method cancels a service task if it's currently queued or running. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationservicetask +#> +function Stop-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='Cancel', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Cancel')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationServiceTask_Cancel'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationServiceTask_CancelViaIdentity'; + } + if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationservice +#> +function Stop-AzDataMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Stop', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Stop', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Stop', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Stop')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StopViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Stop = 'Az.DataMigration.private\Stop-AzDataMigrationService_Stop'; + StopViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationService_StopViaIdentity'; + } + if (('Stop') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationtask +#> +function Stop-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='Cancel', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Cancel')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationTask_Cancel'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationTask_CancelViaIdentity'; + } + if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This method checks whether a proposed nested resource name is valid and available. +.Description +This method checks whether a proposed nested resource name is valid and available. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : A resource type and proposed name + [Name ]: The proposed resource name + [Type ]: The resource type chain (e.g. virtualMachines/extensions) +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicechildnameavailability +#> +function Test-AzDataMigrationServiceChildNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest] + # A resource type and proposed name + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The proposed resource name + ${Name}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource type chain (e.g. + # virtualMachines/extensions) + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_Check'; + CheckExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_CheckExpanded'; + CheckViaIdentity = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This method checks whether a proposed top-level resource name is valid and available. +.Description +This method checks whether a proposed top-level resource name is valid and available. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : A resource type and proposed name + [Name ]: The proposed resource name + [Type ]: The resource type chain (e.g. virtualMachines/extensions) +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicenameavailability +#> +function Test-AzDataMigrationServiceNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The Azure region of the operation + ${Location}, + + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest] + # A resource type and proposed name + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The proposed resource name + ${Name}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource type chain (e.g. + # virtualMachines/extensions) + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_Check'; + CheckExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_CheckExpanded'; + CheckViaIdentity = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicestatus +#> +function Test-AzDataMigrationServiceStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse])] +[CmdletBinding(DefaultParameterSetName='Check', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Check', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Check')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.DataMigration.private\Test-AzDataMigrationServiceStatus_Check'; + CheckViaIdentity = 'Az.DataMigration.private\Test-AzDataMigrationServiceStatus_CheckViaIdentity'; + } + if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This method updates an existing file. +.Description +This method updates an existing file. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationfile +#> +function Update-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Optional File extension. + # If submitted it should not have a leading period and must match the extension from filePath. + ${Extension}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Relative path of this file resource. + # This property can be set when creating or updating the file resource. + ${FilePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # File content type. + # This property can be modified to reflect the file content type. + ${MediaType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationFile_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationFile_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The PATCH method updates an existing project. +.Description +The project resource is a nested resource representing a stored migration project. +The PATCH method updates an existing project. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DATABASESINFO : List of DatabaseInfo + SourceDatabaseName : Name of the database + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationproject +#> +function Update-AzDataMigrationProject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Key used to authenticate to the Azure Active Directory Application + ${AzureAuthenticationInfoAppKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Application ID of the Azure Active Directory Application + ${AzureAuthenticationInfoApplicationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Ignore checking azure permissions on the AAD app + ${AzureAuthenticationInfoIgnoreAzurePermission}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Tenant id of the customer + ${AzureAuthenticationInfoTenantId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]] + # List of DatabaseInfo + # To construct, see NOTES section for DATABASESINFO properties and create a hash table. + ${DatabasesInfo}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${SourceConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${SourceConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${SourceConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform] + # Source platform for the project + ${SourcePlatform}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${TargetConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${TargetConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${TargetConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform] + # Target platform for the project + ${TargetPlatform}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationProject_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationProject_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationservicetask +#> +function Update-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationServiceTask_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationServiceTask_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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\"). +.Description +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\"). +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationservice +#> +function Update-AzDataMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The time delay before the service is auto-stopped when idle. + ${AutoStopDelay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether service resources should be deleted when stopped. + # (Turned on by default) + ${DeleteResourcesOnStop}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # Ignored if submitted + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource kind. + # Only 'vm' (the default) is supported. + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The public key of the service, used to encrypt secrets sent to the service + ${PublicKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Int32] + # The capacity of the SKU, if it supports scaling + ${SkuCapacity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. + # for virtual machines + ${SkuFamily}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The unique name of the SKU, such as 'P3' + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. + # 'A1' for virtual machines + ${SkuSize}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/networkInterfaces resource which the service have + ${VirtualNicId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + ${VirtualSubnetId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationService_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationService_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update Database Migration Service. +.Description +Update Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationsqlmigrationservice +#> +function Update-AzDataMigrationSqlMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationSqlMigrationService_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationtask +#> +function Update-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationTask_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationTask_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/README.md b/swaggerci/datamigration/exports/README.md new file mode 100644 index 000000000000..fe0a94ed4718 --- /dev/null +++ b/swaggerci/datamigration/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.DataMigration`. No other cmdlets in this repository are directly exported. What that means is the `Az.DataMigration` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.DataMigration.private.dll`) and from the `../custom/Az.DataMigration.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](../internal/README.md) in the `../internal` folder. + +## Purpose +We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles. + +## Structure +The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile. + +## Usage +When `./Az.DataMigration.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message. \ No newline at end of file diff --git a/swaggerci/datamigration/exports/Read-AzDataMigrationFile.ps1 b/swaggerci/datamigration/exports/Read-AzDataMigrationFile.ps1 new file mode 100644 index 000000000000..4b4449b72b78 --- /dev/null +++ b/swaggerci/datamigration/exports/Read-AzDataMigrationFile.ps1 @@ -0,0 +1,213 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This method is used for requesting storage information using which contents of the file can be downloaded. +.Description +This method is used for requesting storage information using which contents of the file can be downloaded. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/read-azdatamigrationfile +#> +function Read-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo])] +[CmdletBinding(DefaultParameterSetName='Read', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Read')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ReadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Read = 'Az.DataMigration.private\Read-AzDataMigrationFile_Read'; + ReadViaIdentity = 'Az.DataMigration.private\Read-AzDataMigrationFile_ReadViaIdentity'; + } + if (('Read') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Read-AzDataMigrationFileWrite.ps1 b/swaggerci/datamigration/exports/Read-AzDataMigrationFileWrite.ps1 new file mode 100644 index 000000000000..3a5299886749 --- /dev/null +++ b/swaggerci/datamigration/exports/Read-AzDataMigrationFileWrite.ps1 @@ -0,0 +1,212 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This method is used for requesting information for reading and writing the file content. +.Description +This method is used for requesting information for reading and writing the file content. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/read-azdatamigrationfilewrite +#> +function Read-AzDataMigrationFileWrite { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo])] +[CmdletBinding(DefaultParameterSetName='Read', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${FileName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Read', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Read')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ReadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Read = 'Az.DataMigration.private\Read-AzDataMigrationFileWrite_Read'; + ReadViaIdentity = 'Az.DataMigration.private\Read-AzDataMigrationFileWrite_ReadViaIdentity'; + } + if (('Read') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationDatabaseMigrationsSqlDb.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationDatabaseMigrationsSqlDb.ps1 new file mode 100644 index 000000000000..8f34486792d1 --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationDatabaseMigrationsSqlDb.ps1 @@ -0,0 +1,232 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete Database Migration resource. +.Description +Delete Database Migration resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationdatabasemigrationssqldb +#> +function Remove-AzDataMigrationDatabaseMigrationsSqlDb { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Optional force delete boolean. + # If this is provided as true, migration will be deleted even if active. + ${Force}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationDatabaseMigrationsSqlDb_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationFile.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationFile.ps1 new file mode 100644 index 000000000000..19d1e0a38555 --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationFile.ps1 @@ -0,0 +1,219 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This method deletes a file. +.Description +This method deletes a file. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationfile +#> +function Remove-AzDataMigrationFile { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationFile_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationFile_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationProject.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationProject.ps1 new file mode 100644 index 000000000000..1802d187a1ef --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationProject.ps1 @@ -0,0 +1,221 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The DELETE method deletes a project. +.Description +The project resource is a nested resource representing a stored migration project. +The DELETE method deletes a project. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationproject +#> +function Remove-AzDataMigrationProject { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationProject_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationProject_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationService.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationService.ps1 new file mode 100644 index 000000000000..e8b510bf5278 --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationService.ps1 @@ -0,0 +1,229 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationservice +#> +function Remove-AzDataMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationService_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationService_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationServiceTask.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationServiceTask.ps1 new file mode 100644 index 000000000000..feb48f3b23b0 --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationServiceTask.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The DELETE method deletes a service task, canceling it first if it's running. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The DELETE method deletes a service task, canceling it first if it's running. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationservicetask +#> +function Remove-AzDataMigrationServiceTask { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationServiceTask_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationServiceTask_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationSqlMigrationService.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationSqlMigrationService.ps1 new file mode 100644 index 000000000000..dc78846c6b3a --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationSqlMigrationService.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete Database Migration Service. +.Description +Delete Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationsqlmigrationservice +#> +function Remove-AzDataMigrationSqlMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationService_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationService_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationSqlMigrationServiceNode.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationSqlMigrationServiceNode.ps1 new file mode 100644 index 000000000000..fdbb17837244 --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationSqlMigrationServiceNode.ps1 @@ -0,0 +1,241 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete the integration runtime node. +.Description +Delete the integration runtime node. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Details of node to be deleted. + [IntegrationRuntimeName ]: The name of integration runtime. + [NodeName ]: The name of node to delete. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationsqlmigrationservicenode +#> +function Remove-AzDataMigrationSqlMigrationServiceNode { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode])] +[CmdletBinding(DefaultParameterSetName='DeleteExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${SqlMigrationServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='DeleteExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Delete', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode] + # Details of node to be deleted. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='DeleteExpanded')] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The name of integration runtime. + ${IntegrationRuntimeName}, + + [Parameter(ParameterSetName='DeleteExpanded')] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The name of node to delete. + ${NodeName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_Delete'; + DeleteExpanded = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_DeleteExpanded'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity'; + DeleteViaIdentityExpanded = 'Az.DataMigration.private\Remove-AzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded'; + } + if (('Delete', 'DeleteExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Remove-AzDataMigrationTask.ps1 b/swaggerci/datamigration/exports/Remove-AzDataMigrationTask.ps1 new file mode 100644 index 000000000000..8786d6a4986b --- /dev/null +++ b/swaggerci/datamigration/exports/Remove-AzDataMigrationTask.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/remove-azdatamigrationtask +#> +function Remove-AzDataMigrationTask { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Delete the resource even if it contains running tasks + ${DeleteRunningTask}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.DataMigration.private\Remove-AzDataMigrationTask_Delete'; + DeleteViaIdentity = 'Az.DataMigration.private\Remove-AzDataMigrationTask_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Start-AzDataMigrationService.ps1 b/swaggerci/datamigration/exports/Start-AzDataMigrationService.ps1 new file mode 100644 index 000000000000..84a0a0939541 --- /dev/null +++ b/swaggerci/datamigration/exports/Start-AzDataMigrationService.ps1 @@ -0,0 +1,221 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/start-azdatamigrationservice +#> +function Start-AzDataMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Start', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Start', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Start', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Start')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StartViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Start = 'Az.DataMigration.private\Start-AzDataMigrationService_Start'; + StartViaIdentity = 'Az.DataMigration.private\Start-AzDataMigrationService_StartViaIdentity'; + } + if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlDb.ps1 b/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlDb.ps1 new file mode 100644 index 000000000000..bc023244ab5d --- /dev/null +++ b/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlDb.ps1 @@ -0,0 +1,252 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Stop on going migration for the database. +.Description +Stop on going migration for the database. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqldb +#> +function Stop-AzDataMigrationDatabaseMigrationsSqlDb { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CancelExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlDbInstanceName}, + + [Parameter(ParameterSetName='Cancel')] + [Parameter(ParameterSetName='CancelExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cancel', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CancelExpanded')] + [Parameter(ParameterSetName='CancelViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_Cancel'; + CancelExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity'; + CancelViaIdentityExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded'; + } + if (('Cancel', 'CancelExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlMi.ps1 b/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlMi.ps1 new file mode 100644 index 000000000000..90c546f06e14 --- /dev/null +++ b/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlMi.ps1 @@ -0,0 +1,252 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Stop in-progress database migration to SQL Managed Instance. +.Description +Stop in-progress database migration to SQL Managed Instance. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqlmi +#> +function Stop-AzDataMigrationDatabaseMigrationsSqlMi { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CancelExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${ManagedInstanceName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cancel')] + [Parameter(ParameterSetName='CancelExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cancel', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CancelExpanded')] + [Parameter(ParameterSetName='CancelViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_Cancel'; + CancelExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity'; + CancelViaIdentityExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded'; + } + if (('Cancel', 'CancelExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlVM.ps1 b/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlVM.ps1 new file mode 100644 index 000000000000..a02f28f0e018 --- /dev/null +++ b/swaggerci/datamigration/exports/Stop-AzDataMigrationDatabaseMigrationsSqlVM.ps1 @@ -0,0 +1,252 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Stop in-progress database migration to SQL VM. +.Description +Stop in-progress database migration to SQL VM. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : Migration Operation Input + [MigrationOperationId ]: ID tracking migration operation. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationdatabasemigrationssqlvm +#> +function Stop-AzDataMigrationDatabaseMigrationsSqlVM { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CancelExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # . + ${SqlVirtualMachineName}, + + [Parameter(ParameterSetName='Cancel')] + [Parameter(ParameterSetName='CancelExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The name of the target database. + ${TargetDbName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Cancel', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput] + # Migration Operation Input + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CancelExpanded')] + [Parameter(ParameterSetName='CancelViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # ID tracking migration operation. + ${MigrationOperationId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_Cancel'; + CancelExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity'; + CancelViaIdentityExpanded = 'Az.DataMigration.private\Stop-AzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded'; + } + if (('Cancel', 'CancelExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Stop-AzDataMigrationService.ps1 b/swaggerci/datamigration/exports/Stop-AzDataMigrationService.ps1 new file mode 100644 index 000000000000..78955dd6d2b0 --- /dev/null +++ b/swaggerci/datamigration/exports/Stop-AzDataMigrationService.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationservice +#> +function Stop-AzDataMigrationService { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Stop', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Stop', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Stop', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='Stop')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StopViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Stop = 'Az.DataMigration.private\Stop-AzDataMigrationService_Stop'; + StopViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationService_StopViaIdentity'; + } + if (('Stop') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Stop-AzDataMigrationServiceTask.ps1 b/swaggerci/datamigration/exports/Stop-AzDataMigrationServiceTask.ps1 new file mode 100644 index 000000000000..4c6110078852 --- /dev/null +++ b/swaggerci/datamigration/exports/Stop-AzDataMigrationServiceTask.ps1 @@ -0,0 +1,208 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method cancels a service task if it's currently queued or running. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +This method cancels a service task if it's currently queued or running. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationservicetask +#> +function Stop-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='Cancel', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Cancel')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationServiceTask_Cancel'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationServiceTask_CancelViaIdentity'; + } + if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Stop-AzDataMigrationTask.ps1 b/swaggerci/datamigration/exports/Stop-AzDataMigrationTask.ps1 new file mode 100644 index 000000000000..c65e39227381 --- /dev/null +++ b/swaggerci/datamigration/exports/Stop-AzDataMigrationTask.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/stop-azdatamigrationtask +#> +function Stop-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='Cancel', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='Cancel', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Cancel')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CancelViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cancel = 'Az.DataMigration.private\Stop-AzDataMigrationTask_Cancel'; + CancelViaIdentity = 'Az.DataMigration.private\Stop-AzDataMigrationTask_CancelViaIdentity'; + } + if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Test-AzDataMigrationServiceChildNameAvailability.ps1 b/swaggerci/datamigration/exports/Test-AzDataMigrationServiceChildNameAvailability.ps1 new file mode 100644 index 000000000000..dd5e4db84c98 --- /dev/null +++ b/swaggerci/datamigration/exports/Test-AzDataMigrationServiceChildNameAvailability.ps1 @@ -0,0 +1,235 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This method checks whether a proposed nested resource name is valid and available. +.Description +This method checks whether a proposed nested resource name is valid and available. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : A resource type and proposed name + [Name ]: The proposed resource name + [Type ]: The resource type chain (e.g. virtualMachines/extensions) +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicechildnameavailability +#> +function Test-AzDataMigrationServiceChildNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest] + # A resource type and proposed name + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The proposed resource name + ${Name}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource type chain (e.g. + # virtualMachines/extensions) + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_Check'; + CheckExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_CheckExpanded'; + CheckViaIdentity = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Test-AzDataMigrationServiceNameAvailability.ps1 b/swaggerci/datamigration/exports/Test-AzDataMigrationServiceNameAvailability.ps1 new file mode 100644 index 000000000000..0284b0fdb35c --- /dev/null +++ b/swaggerci/datamigration/exports/Test-AzDataMigrationServiceNameAvailability.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This method checks whether a proposed top-level resource name is valid and available. +.Description +This method checks whether a proposed top-level resource name is valid and available. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task + +PARAMETER : A resource type and proposed name + [Name ]: The proposed resource name + [Type ]: The resource type chain (e.g. virtualMachines/extensions) +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicenameavailability +#> +function Test-AzDataMigrationServiceNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # The Azure region of the operation + ${Location}, + + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest] + # A resource type and proposed name + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The proposed resource name + ${Name}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource type chain (e.g. + # virtualMachines/extensions) + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_Check'; + CheckExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_CheckExpanded'; + CheckViaIdentity = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.DataMigration.private\Test-AzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Test-AzDataMigrationServiceStatus.ps1 b/swaggerci/datamigration/exports/Test-AzDataMigrationServiceStatus.ps1 new file mode 100644 index 000000000000..28f15e9287cc --- /dev/null +++ b/swaggerci/datamigration/exports/Test-AzDataMigrationServiceStatus.ps1 @@ -0,0 +1,202 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/test-azdatamigrationservicestatus +#> +function Test-AzDataMigrationServiceStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse])] +[CmdletBinding(DefaultParameterSetName='Check', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='Check', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='Check')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.DataMigration.private\Test-AzDataMigrationServiceStatus_Check'; + CheckViaIdentity = 'Az.DataMigration.private\Test-AzDataMigrationServiceStatus_CheckViaIdentity'; + } + if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Update-AzDataMigrationFile.ps1 b/swaggerci/datamigration/exports/Update-AzDataMigrationFile.ps1 new file mode 100644 index 000000000000..019d9302871b --- /dev/null +++ b/swaggerci/datamigration/exports/Update-AzDataMigrationFile.ps1 @@ -0,0 +1,241 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This method updates an existing file. +.Description +This method updates an existing file. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationfile +#> +function Update-AzDataMigrationFile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('FileName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the File + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Optional File extension. + # If submitted it should not have a leading period and must match the extension from filePath. + ${Extension}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Relative path of this file resource. + # This property can be set when creating or updating the file resource. + ${FilePath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # File content type. + # This property can be modified to reflect the file content type. + ${MediaType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationFile_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationFile_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Update-AzDataMigrationProject.ps1 b/swaggerci/datamigration/exports/Update-AzDataMigrationProject.ps1 new file mode 100644 index 000000000000..460320e7687c --- /dev/null +++ b/swaggerci/datamigration/exports/Update-AzDataMigrationProject.ps1 @@ -0,0 +1,314 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The project resource is a nested resource representing a stored migration project. +The PATCH method updates an existing project. +.Description +The project resource is a nested resource representing a stored migration project. +The PATCH method updates an existing project. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DATABASESINFO : List of DatabaseInfo + SourceDatabaseName : Name of the database + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationproject +#> +function Update-AzDataMigrationProject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ProjectName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Key used to authenticate to the Azure Active Directory Application + ${AzureAuthenticationInfoAppKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Application ID of the Azure Active Directory Application + ${AzureAuthenticationInfoApplicationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Ignore checking azure permissions on the AAD app + ${AzureAuthenticationInfoIgnoreAzurePermission}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Tenant id of the customer + ${AzureAuthenticationInfoTenantId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]] + # List of DatabaseInfo + # To construct, see NOTES section for DATABASESINFO properties and create a hash table. + ${DatabasesInfo}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${SourceConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${SourceConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${SourceConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform] + # Source platform for the project + ${SourcePlatform}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Password credential. + ${TargetConnectionInfoPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # Type of connection info + ${TargetConnectionInfoType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # User name + ${TargetConnectionInfoUserName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform] + # Target platform for the project + ${TargetPlatform}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationProject_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationProject_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Update-AzDataMigrationService.ps1 b/swaggerci/datamigration/exports/Update-AzDataMigrationService.ps1 new file mode 100644 index 000000000000..00b99c603807 --- /dev/null +++ b/swaggerci/datamigration/exports/Update-AzDataMigrationService.ps1 @@ -0,0 +1,309 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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\"). +.Description +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\"). +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationservice +#> +function Update-AzDataMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The time delay before the service is auto-stopped when idle. + ${AutoStopDelay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether service resources should be deleted when stopped. + # (Turned on by default) + ${DeleteResourcesOnStop}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # Ignored if submitted + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The resource kind. + # Only 'vm' (the default) is supported. + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # . + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The public key of the service, used to encrypt secrets sent to the service + ${PublicKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.Int32] + # The capacity of the SKU, if it supports scaling + ${SkuCapacity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. + # for virtual machines + ${SkuFamily}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The unique name of the SKU, such as 'P3' + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. + # 'A1' for virtual machines + ${SkuSize}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/networkInterfaces resource which the service have + ${VirtualNicId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + ${VirtualSubnetId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationService_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationService_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Update-AzDataMigrationServiceTask.ps1 b/swaggerci/datamigration/exports/Update-AzDataMigrationServiceTask.ps1 new file mode 100644 index 000000000000..388cc336b1c3 --- /dev/null +++ b/swaggerci/datamigration/exports/Update-AzDataMigrationServiceTask.ps1 @@ -0,0 +1,229 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so. +.Description +The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. +The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationservicetask +#> +function Update-AzDataMigrationServiceTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${TaskName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationServiceTask_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationServiceTask_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Update-AzDataMigrationSqlMigrationService.ps1 b/swaggerci/datamigration/exports/Update-AzDataMigrationSqlMigrationService.ps1 new file mode 100644 index 000000000000..e5fe07d8c4c0 --- /dev/null +++ b/swaggerci/datamigration/exports/Update-AzDataMigrationSqlMigrationService.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update Database Migration Service. +.Description +Update Database Migration Service. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationsqlmigrationservice +#> +function Update-AzDataMigrationSqlMigrationService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('SqlMigrationServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the SQL Migration Service. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group that contains the resource. + # You can obtain this value from the Azure Resource Manager API or the portal. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags]))] + [System.Collections.Hashtable] + # Dictionary of + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationSqlMigrationService_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/exports/Update-AzDataMigrationTask.ps1 b/swaggerci/datamigration/exports/Update-AzDataMigrationTask.ps1 new file mode 100644 index 000000000000..5e3745375223 --- /dev/null +++ b/swaggerci/datamigration/exports/Update-AzDataMigrationTask.ps1 @@ -0,0 +1,236 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [FileName ]: Name of the File + [GroupName ]: Name of the resource group + [Id ]: Resource identity path + [Location ]: The Azure region of the operation + [ManagedInstanceName ]: + [ProjectName ]: Name of the project + [ResourceGroupName ]: Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + [ServiceName ]: Name of the service + [SqlDbInstanceName ]: + [SqlMigrationServiceName ]: Name of the SQL Migration Service. + [SqlVirtualMachineName ]: + [SubscriptionId ]: Subscription ID that identifies an Azure subscription. + [TargetDbName ]: The name of the target database. + [TaskName ]: Name of the Task +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/update-azdatamigrationtask +#> +function Update-AzDataMigrationTask { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the resource group + ${GroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('TaskName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the Task + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the project + ${ProjectName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [System.String] + # Name of the service + ${ServiceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription ID that identifies an Azure subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData]))] + [System.Collections.Hashtable] + # Key value pairs of client data to attach meta data information to task + ${ClientData}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [System.String] + # HTTP strong entity tag value. + # This is ignored if submitted. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType] + # Task type. + ${TaskType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DataMigration.private\Update-AzDataMigrationTask_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataMigration.private\Update-AzDataMigrationTask_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/datamigration/generate-help.ps1 b/swaggerci/datamigration/generate-help.ps1 new file mode 100644 index 000000000000..6c8cb96e6d69 --- /dev/null +++ b/swaggerci/datamigration/generate-help.ps1 @@ -0,0 +1,66 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(-not (Test-Path $exportsFolder)) { + Write-Error "Exports folder '$exportsFolder' was not found." +} + +$directories = Get-ChildItem -Directory -Path $exportsFolder +$hasProfiles = ($directories | Measure-Object).Count -gt 0 +if(-not $hasProfiles) { + $directories = Get-Item -Path $exportsFolder +} + +$docsFolder = Join-Path $PSScriptRoot 'docs' +if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue +$examplesFolder = Join-Path $PSScriptRoot 'examples' + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.DataMigration.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DataMigration.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName + +foreach($directory in $directories) +{ + if($hasProfiles) { + Select-AzProfile -Name $directory.Name + } + # Reload module per profile + Import-Module -Name $modulePath -Force + + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName + $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full } + $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo + + $docsPath = Join-Path $docsFolder $directory.Name + $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue + $examplesPath = Join-Path $examplesFolder $directory.Name + + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/datamigration/generated/Module.cs b/swaggerci/datamigration/generated/Module.cs new file mode 100644 index 000000000000..0768dd68c8d7 --- /dev/null +++ b/swaggerci/datamigration/generated/Module.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>; + using GetParameterDelegate = global::System.Func; + using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; + using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; + using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; + using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + + /// A class that contains the module-common code and data. + public partial class Module + { + /// The currently selected profile. + public string Profile = global::System.String.Empty; + + public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + + /// the ISendAsync pipeline instance + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline _pipelineWithProxy; + + public bool _useProxy = false; + + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); + + /// Gets completion data for azure specific fields + public ArgumentCompleterDelegate ArgumentCompleter { get; set; } + + /// The instance of the Client API + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient ClientAPI { get; set; } + + /// A delegate that gets called for each signalled event + public EventListenerDelegate EventListener { get; set; } + + /// The delegate to call to get parameter data from a common module. + public GetParameterDelegate GetParameterValue { get; set; } + + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + + /// Backing field for property. + private static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module()); + + /// The Name of this module + public string Name => @"Az.DataMigration"; + + /// The delegate to call when this module is loaded (supporting a commmon module). + public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } + + /// The delegate to call before each new request (supporting a commmon module). + public NewRequestPipelineDelegate OnNewRequest { get; set; } + + /// The name of the currently selected Azure profile + public global::System.String ProfileName { get; set; } + + /// The ResourceID for this module (azure arm). + public string ResourceId => @"Az.DataMigration"; + + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline pipeline); + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline pipeline); + + partial void CustomInit(); + + /// Creates an instance of the HttpPipeline for each call. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the cmdlet's parameterset name. + /// a dict for extensible parameters + /// An instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline pipeline = null; + BeforeCreatePipeline(invocationInfo, ref pipeline); + pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone(); + AfterCreatePipeline(invocationInfo, ref pipeline); + pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync); + OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } ); + return pipeline; + } + + /// Gets parameters from a common module. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// The name of the parameter to get the value for. + /// + /// The parameter value from the common module. (Note: this should be type converted on the way back) + /// + public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName ); + + /// Initialization steps performed after the module is loaded. + public void Init() + { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + } + + /// Creates the module instance. + private Module() + { + /// constructor + ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler))); + } + + /// The HTTP Proxy to use. + /// The HTTP Proxy Credentials + /// True if the proxy should use default credentials + public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials) + { + _useProxy = proxy != null; + if (proxy == null) + { + return; + } + // set the proxy configuration + _webProxy.Address = proxy; + _webProxy.BypassProxyOnLocal = false; + if (proxyUseDefaultCredentials) + { + _webProxy.Credentials = null; + _webProxy.UseDefaultCredentials = true; + } + else + { + _webProxy.UseDefaultCredentials = false; + _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); + } + } + + /// Called to dispatch events to the common module listener + /// The ID of the event + /// The cancellation token for the event + /// A delegate to get the detailed event data + /// The callback for the event dispatcher + /// The from the cmdlet + /// the cmdlet's parameterset name. + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the exception that is being thrown (if available) + /// + /// A that will be complete when handling of the event is completed. + /// + public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception) + { + using( NoSynchronizationContext ) + { + await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/DataMigrationManagementClient.cs b/swaggerci/datamigration/generated/api/DataMigrationManagementClient.cs new file mode 100644 index 000000000000..c17e3f3d7df3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/DataMigrationManagementClient.cs @@ -0,0 +1,13326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Low-level API implementation for the DataMigrationManagementClient service. + /// Data Migration Client + /// + public partial class DataMigrationManagementClient + { + + /// Stop on going migration for the database. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Required migration operation ID for which cancel will be initiated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCancel(string resourceGroupName, string sqlDbInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/servers/" + + global::System.Uri.EscapeDataString(sqlDbInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Stop on going migration for the database. + /// + /// Required migration operation ID for which cancel will be initiated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCancelViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/servers/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)/cancel$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlDbInstanceName = _match.Groups["sqlDbInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/servers/" + + sqlDbInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Required migration operation ID for which cancel will be initiated. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCancel_Validate(string resourceGroupName, string sqlDbInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlDbInstanceName),sqlDbInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create or Update Database Migration resource. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Details of Sql Db migration resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCreateOrUpdate(string resourceGroupName, string sqlDbInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/servers/" + + global::System.Uri.EscapeDataString(sqlDbInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or Update Database Migration resource. + /// + /// Details of Sql Db migration resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/servers/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlDbInstanceName = _match.Groups["sqlDbInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/servers/" + + sqlDbInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlDb.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Details of Sql Db migration resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbCreateOrUpdate_Validate(string resourceGroupName, string sqlDbInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlDbInstanceName),sqlDbInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete Database Migration resource. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbDelete(string resourceGroupName, string sqlDbInstanceName, string targetDbName, bool? force, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/servers/" + + global::System.Uri.EscapeDataString(sqlDbInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "?" + + (null == force ? global::System.String.Empty : "force=" + global::System.Uri.EscapeDataString(force.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete Database Migration resource. + /// + /// Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbDeleteViaIdentity(global::System.String viaIdentity, bool? force, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/servers/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlDbInstanceName = _match.Groups["sqlDbInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/servers/" + + sqlDbInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "?" + + (null == force ? global::System.String.Empty : "force=" + global::System.Uri.EscapeDataString(force.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbDelete_Validate(string resourceGroupName, string sqlDbInstanceName, string targetDbName, bool? force, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlDbInstanceName),sqlDbInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Retrieve the Database Migration resource. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// 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. + /// Complete migration details be included in the response. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbGet(string resourceGroupName, string sqlDbInstanceName, string targetDbName, string migrationOperationId, string Expand, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/servers/" + + global::System.Uri.EscapeDataString(sqlDbInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "?" + + (string.IsNullOrEmpty(migrationOperationId) ? global::System.String.Empty : "migrationOperationId=" + global::System.Uri.EscapeDataString(migrationOperationId)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve the Database Migration resource. + /// + /// 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. + /// Complete migration details be included in the response. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbGetViaIdentity(global::System.String viaIdentity, string migrationOperationId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/servers/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlDbInstanceName = _match.Groups["sqlDbInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/servers/" + + sqlDbInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "?" + + (string.IsNullOrEmpty(migrationOperationId) ? global::System.String.Empty : "migrationOperationId=" + global::System.Uri.EscapeDataString(migrationOperationId)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlDbGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlDb.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// 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. + /// Complete migration details be included in the response. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlDbGet_Validate(string resourceGroupName, string sqlDbInstanceName, string targetDbName, string migrationOperationId, string Expand, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlDbInstanceName),sqlDbInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertRegEx(nameof(migrationOperationId),migrationOperationId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Stop in-progress database migration to SQL Managed Instance. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Required migration operation ID for which cancel will be initiated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCancel(string resourceGroupName, string managedInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/managedInstances/" + + global::System.Uri.EscapeDataString(managedInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Stop in-progress database migration to SQL Managed Instance. + /// + /// Required migration operation ID for which cancel will be initiated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCancelViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/managedInstances/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)/cancel$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managedInstanceName = _match.Groups["managedInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/managedInstances/" + + managedInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Required migration operation ID for which cancel will be initiated. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCancel_Validate(string resourceGroupName, string managedInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managedInstanceName),managedInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a new database migration to a given SQL Managed Instance. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCreateOrUpdate(string resourceGroupName, string managedInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/managedInstances/" + + global::System.Uri.EscapeDataString(managedInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create a new database migration to a given SQL Managed Instance. + /// + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/managedInstances/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managedInstanceName = _match.Groups["managedInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/managedInstances/" + + managedInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlMi.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCreateOrUpdate_Validate(string resourceGroupName, string managedInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managedInstanceName),managedInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Initiate cutover for in-progress online database migration to SQL Managed Instance. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Required migration operation ID for which cutover will be initiated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCutover(string resourceGroupName, string managedInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/managedInstances/" + + global::System.Uri.EscapeDataString(managedInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "/cutover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiCutover_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Initiate cutover for in-progress online database migration to SQL Managed Instance. + /// + /// + /// Required migration operation ID for which cutover will be initiated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCutoverViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/managedInstances/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)/cutover$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managedInstanceName = _match.Groups["managedInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/managedInstances/" + + managedInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "/cutover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiCutover_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCutover_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Required migration operation ID for which cutover will be initiated. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiCutover_Validate(string resourceGroupName, string managedInstanceName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managedInstanceName),managedInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Retrieve the specified database migration for a given SQL Managed Instance. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// 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. + /// Complete migration details be included in the response. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiGet(string resourceGroupName, string managedInstanceName, string targetDbName, string migrationOperationId, string Expand, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Sql/managedInstances/" + + global::System.Uri.EscapeDataString(managedInstanceName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "?" + + (string.IsNullOrEmpty(migrationOperationId) ? global::System.String.Empty : "migrationOperationId=" + global::System.Uri.EscapeDataString(migrationOperationId)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve the specified database migration for a given SQL Managed Instance. + /// + /// 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. + /// Complete migration details be included in the response. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiGetViaIdentity(global::System.String viaIdentity, string migrationOperationId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Sql/managedInstances/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managedInstanceName = _match.Groups["managedInstanceName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Sql/managedInstances/" + + managedInstanceName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "?" + + (string.IsNullOrEmpty(migrationOperationId) ? global::System.String.Empty : "migrationOperationId=" + global::System.Uri.EscapeDataString(migrationOperationId)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlMiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlMi.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// 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. + /// Complete migration details be included in the response. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlMiGet_Validate(string resourceGroupName, string managedInstanceName, string targetDbName, string migrationOperationId, string Expand, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managedInstanceName),managedInstanceName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertRegEx(nameof(migrationOperationId),migrationOperationId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Stop in-progress database migration to SQL VM. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Migration Operation Input + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCancel(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + global::System.Uri.EscapeDataString(sqlVirtualMachineName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Stop in-progress database migration to SQL VM. + /// + /// Migration Operation Input + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCancelViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)/cancel$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlVirtualMachineName = _match.Groups["sqlVirtualMachineName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + sqlVirtualMachineName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Migration Operation Input + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCancel_Validate(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlVirtualMachineName),sqlVirtualMachineName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a new database migration to a given SQL VM. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCreateOrUpdate(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + global::System.Uri.EscapeDataString(sqlVirtualMachineName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create a new database migration to a given SQL VM. + /// + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlVirtualMachineName = _match.Groups["sqlVirtualMachineName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + sqlVirtualMachineName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlVM.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCreateOrUpdate_Validate(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlVirtualMachineName),sqlVirtualMachineName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Initiate cutover for in-progress online database migration to SQL VM. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Migration Operation Input + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCutover(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + global::System.Uri.EscapeDataString(sqlVirtualMachineName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "/cutover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMCutover_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Initiate cutover for in-progress online database migration to SQL VM. + /// + /// Migration Operation Input + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCutoverViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)/cutover$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlVirtualMachineName = _match.Groups["sqlVirtualMachineName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + sqlVirtualMachineName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "/cutover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMCutover_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCutover_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// Subscription ID that identifies an Azure subscription. + /// Migration Operation Input + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMCutover_Validate(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlVirtualMachineName),sqlVirtualMachineName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Retrieve the specified database migration for a given SQL VM. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// 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. + /// Complete migration details be included in the response. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMGet(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string migrationOperationId, string Expand, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + global::System.Uri.EscapeDataString(sqlVirtualMachineName) + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + global::System.Uri.EscapeDataString(targetDbName) + + "?" + + (string.IsNullOrEmpty(migrationOperationId) ? global::System.String.Empty : "migrationOperationId=" + global::System.Uri.EscapeDataString(migrationOperationId)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve the specified database migration for a given SQL VM. + /// + /// 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. + /// Complete migration details be included in the response. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMGetViaIdentity(global::System.String viaIdentity, string migrationOperationId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/(?[^/]+)/providers/Microsoft.DataMigration/databaseMigrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlVirtualMachineName = _match.Groups["sqlVirtualMachineName"].Value; + var targetDbName = _match.Groups["targetDbName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/" + + sqlVirtualMachineName + + "/providers/Microsoft.DataMigration/databaseMigrations/" + + targetDbName + + "?" + + (string.IsNullOrEmpty(migrationOperationId) ? global::System.String.Empty : "migrationOperationId=" + global::System.Uri.EscapeDataString(migrationOperationId)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DatabaseMigrationsSqlVMGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlVM.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// + /// The name of the target database. + /// 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. + /// Complete migration details be included in the response. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DatabaseMigrationsSqlVMGet_Validate(string resourceGroupName, string sqlVirtualMachineName, string targetDbName, string migrationOperationId, string Expand, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlVirtualMachineName),sqlVirtualMachineName); + await eventListener.AssertNotNull(nameof(targetDbName),targetDbName); + await eventListener.AssertRegEx(nameof(migrationOperationId),migrationOperationId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// The PUT method creates a new file or updates an existing one. + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// Information about the file + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesCreateOrUpdate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/files/" + + global::System.Uri.EscapeDataString(fileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// The PUT method creates a new file or updates an existing one. + /// + /// Information about the file + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/files/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var fileName = _match.Groups["fileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/files/" + + fileName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// Information about the file + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesCreateOrUpdate_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(fileName),fileName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// This method deletes a file. + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesDelete(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/files/" + + global::System.Uri.EscapeDataString(fileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// This method deletes a file. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/files/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var fileName = _match.Groups["fileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/files/" + + fileName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesDelete_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(fileName),fileName); + } + } + + /// + /// The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method + /// retrieves information about a file. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesGet(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/files/" + + global::System.Uri.EscapeDataString(fileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method + /// retrieves information about a file. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/files/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var fileName = _match.Groups["fileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/files/" + + fileName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesGet_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(fileName),fileName); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. This method returns a list of files + /// owned by a project resource. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesList(string subscriptionId, string groupName, string serviceName, string projectName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/files" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. This method returns a list of files + /// owned by a project resource. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/files$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/files" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesList_Validate(string subscriptionId, string groupName, string serviceName, string projectName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + } + } + + /// + /// This method is used for requesting storage information using which contents of the file can be downloaded. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesRead(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/files/" + + global::System.Uri.EscapeDataString(fileName) + + "/read" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesRead_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This method is used for requesting storage information using which contents of the file can be downloaded. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesReadViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/files/(?[^/]+)/read$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var fileName = _match.Groups["fileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/files/" + + fileName + + "/read" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesRead_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This method is used for requesting information for reading and writing the file content. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesReadWrite(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/files/" + + global::System.Uri.EscapeDataString(fileName) + + "/readwrite" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesReadWrite_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This method is used for requesting information for reading and writing the file content. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesReadWriteViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/files/(?[^/]+)/readwrite$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var fileName = _match.Groups["fileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/files/" + + fileName + + "/readwrite" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesReadWrite_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesReadWrite_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesReadWrite_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(fileName),fileName); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesRead_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesRead_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(fileName),fileName); + } + } + + /// This method updates an existing file. + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// Information about the file + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesUpdate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/files/" + + global::System.Uri.EscapeDataString(fileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// This method updates an existing file. + /// + /// Information about the file + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FilesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/files/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var fileName = _match.Groups["fileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/files/" + + fileName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FilesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the File + /// Information about the file + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FilesUpdate_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string fileName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(fileName),fileName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists all of the available SQL Migration REST API operations. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.DataMigration/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all of the available SQL Migration REST API operations. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.DataMigration/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.DataMigration/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.DataMigration/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The PUT method creates a new project + /// or updates an existing one. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Information about the project + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsCreateOrUpdate(string subscriptionId, string groupName, string serviceName, string projectName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The PUT method creates a new project + /// or updates an existing one. + /// + /// + /// Information about the project + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Information about the project + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsCreateOrUpdate_Validate(string subscriptionId, string groupName, string serviceName, string projectName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsDelete(string subscriptionId, string groupName, string serviceName, string projectName, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + /// + /// + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsDeleteViaIdentity(global::System.String viaIdentity, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Delete the resource even if it contains running tasks + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsDelete_Validate(string subscriptionId, string groupName, string serviceName, string projectName, bool? deleteRunningTasks, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The GET method retrieves information + /// about a project. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsGet(string subscriptionId, string groupName, string serviceName, string projectName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The GET method retrieves information + /// about a project. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsGet_Validate(string subscriptionId, string groupName, string serviceName, string projectName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. This method returns a list of projects + /// owned by a service resource. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsList(string subscriptionId, string groupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. This method returns a list of projects + /// owned by a service resource. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsList_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing + /// project. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Information about the project + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsUpdate(string subscriptionId, string groupName, string serviceName, string projectName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing + /// project. + /// + /// + /// Information about the project + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProjectsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProjectsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Information about the project + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProjectsUpdate_Validate(string subscriptionId, string groupName, string serviceName, string projectName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// The skus action returns the list of SKUs that DMS supports. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceSkusListSkus(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.DataMigration/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceSkusListSkus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// The skus action returns the list of SKUs that DMS supports. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceSkusListSkusViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DataMigration/skus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.DataMigration/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceSkusListSkus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceSkusListSkus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceSkusListSkus_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + /// cancels a service task if it's currently queued or running. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksCancel(string subscriptionId, string groupName, string serviceName, string taskName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/serviceTasks/" + + global::System.Uri.EscapeDataString(taskName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + /// cancels a service task if it's currently queued or running. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksCancelViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/serviceTasks/(?[^/]+)/cancel$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/serviceTasks/" + + taskName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksCancel_Validate(string subscriptionId, string groupName, string serviceName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + /// creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, + /// there is little reason to update an existing one. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksCreateOrUpdate(string subscriptionId, string groupName, string serviceName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/serviceTasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + /// creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, + /// there is little reason to update an existing one. + /// + /// + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/serviceTasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/serviceTasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Information about the task + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksCreateOrUpdate_Validate(string subscriptionId, string groupName, string serviceName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + /// method deletes a service task, canceling it first if it's running. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksDelete(string subscriptionId, string groupName, string serviceName, string taskName, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/serviceTasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + /// method deletes a service task, canceling it first if it's running. + /// + /// + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksDeleteViaIdentity(global::System.String viaIdentity, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/serviceTasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/serviceTasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Delete the resource even if it contains running tasks + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksDelete_Validate(string subscriptionId, string groupName, string serviceName, string taskName, bool? deleteRunningTasks, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + /// retrieves information about a service task. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Expand the response + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksGet(string subscriptionId, string groupName, string serviceName, string taskName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/serviceTasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + /// retrieves information about a service task. + /// + /// + /// Expand the response + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/serviceTasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/serviceTasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Expand the response + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksGet_Validate(string subscriptionId, string groupName, string serviceName, string taskName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. This method returns a + /// list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that + /// an error occurred while querying the status of that task. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Filter tasks by task type + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksList(string subscriptionId, string groupName, string serviceName, string taskType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/serviceTasks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(taskType) ? global::System.String.Empty : "taskType=" + global::System.Uri.EscapeDataString(taskType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. This method returns a + /// list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that + /// an error occurred while querying the status of that task. + /// + /// + /// Filter tasks by task type + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksListViaIdentity(global::System.String viaIdentity, string taskType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/serviceTasks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/serviceTasks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(taskType) ? global::System.String.Empty : "taskType=" + global::System.Uri.EscapeDataString(taskType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TaskList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Filter tasks by task type + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksList_Validate(string subscriptionId, string groupName, string serviceName, string taskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(taskType),taskType); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method + /// updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to + /// do so. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksUpdate(string subscriptionId, string groupName, string serviceName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/serviceTasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method + /// updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to + /// do so. + /// + /// + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServiceTasksUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/serviceTasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/serviceTasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServiceTasksUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the Task + /// Information about the task + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServiceTasksUpdate_Validate(string subscriptionId, string groupName, string serviceName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// This method checks whether a proposed nested resource name is valid and available. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Requested name to validate + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCheckChildrenNameAvailability(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckChildrenNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This method checks whether a proposed nested resource name is valid and available. + /// + /// + /// Requested name to validate + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCheckChildrenNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/checkNameAvailability$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckChildrenNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCheckChildrenNameAvailability_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Requested name to validate + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCheckChildrenNameAvailability_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// This method checks whether a proposed top-level resource name is valid and available. + /// + /// Subscription ID that identifies an Azure subscription. + /// The Azure region of the operation + /// Requested name to validate + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCheckNameAvailability(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.DataMigration/locations/" + + global::System.Uri.EscapeDataString(location) + + "/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This method checks whether a proposed top-level resource name is valid and available. + /// + /// + /// Requested name to validate + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DataMigration/locations/(?[^/]+)/checkNameAvailability$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.DataMigration/locations/" + + location + + "/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCheckNameAvailability_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// The Azure region of the operation + /// Requested name to validate + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCheckNameAvailability_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCheckStatus(string subscriptionId, string groupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/checkStatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCheckStatusViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/checkStatus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/checkStatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCheckStatus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceStatusResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCheckStatus_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + } + } + + /// + /// 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 ("ServiceIsBusy"). The provider will reply when successful with + /// 200 OK or 201 Created. Long-running operations use the provisioningState property. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Information about the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCreateOrUpdate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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 ("ServiceIsBusy"). The provider will reply when successful with + /// 200 OK or 201 Created. Long-running operations use the provisioningState property. + /// + /// + /// Information about the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Information about the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesCreateOrUpdate_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesDelete(string subscriptionId, string groupName, string serviceName, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesDeleteViaIdentity(global::System.String viaIdentity, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Delete the resource even if it contains running tasks + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesDelete_Validate(string subscriptionId, string groupName, string serviceName, bool? deleteRunningTasks, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + } + } + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves + /// information about a service instance. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesGet(string subscriptionId, string groupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves + /// information about a service instance. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesGet_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.DataMigration/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesListByResourceGroup(string subscriptionId, string groupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesListByResourceGroup_Validate(string subscriptionId, string groupName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesListSkus(string subscriptionId, string groupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesListSkus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesListSkusViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/skus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesListSkus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesListSkus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSkuList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesListSkus_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DataMigration/services$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.DataMigration/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesStart(string subscriptionId, string groupName, string serviceName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/start" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesStart_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesStartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/start$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/start" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesStart_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesStart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesStart_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesStop(string subscriptionId, string groupName, string serviceName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/stop" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesStop_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesStopViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/stop$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/stop" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesStop_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesStop_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesStop_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + } + } + + /// + /// 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"). + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Information about the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesUpdate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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"). + /// + /// + /// Information about the service + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Information about the service + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicesUpdate_Validate(string subscriptionId, string groupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create or Update Database Migration Service. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesCreateOrUpdate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or Update Database Migration Service. + /// + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesCreateOrUpdate_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete Database Migration Service. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesDelete(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the integration runtime node. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesDeleteNode(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "/deleteNode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesDeleteNode_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Delete the integration runtime node. + /// + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesDeleteNodeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)/deleteNode$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "/deleteNode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesDeleteNode_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesDeleteNode_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DeleteNode.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesDeleteNode_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete Database Migration Service. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesDelete_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Retrieve the Database Migration Service + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesGet(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve the Database Migration Service + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesGet_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListAuthKeys(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "/listAuthKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListAuthKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListAuthKeysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)/listAuthKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "/listAuthKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListAuthKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListAuthKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AuthenticationKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListAuthKeys_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Retrieve all SQL migration services in the resource group. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListByResourceGroup(string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve all SQL migration services in the resource group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Retrieve all SQL migration services in the subscriptions. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.DataMigration/sqlMigrationServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve all SQL migration services in the subscriptions. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.DataMigration/sqlMigrationServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Retrieve the List of database migrations attached to the service. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListMigrations(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "/listMigrations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListMigrations_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve the List of database migrations attached to the service. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListMigrationsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)/listMigrations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "/listMigrations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListMigrations_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListMigrations_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListMigrations_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// + /// Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListMonitoringData(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "/listMonitoringData" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListMonitoringData_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesListMonitoringDataViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)/listMonitoringData$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "/listMonitoringData" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesListMonitoringData_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListMonitoringData_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IntegrationRuntimeMonitoringData.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesListMonitoringData_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// + /// Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesRegenerateAuthKeys(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "/regenerateAuthKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesRegenerateAuthKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + /// + /// + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesRegenerateAuthKeysViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)/regenerateAuthKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "/regenerateAuthKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesRegenerateAuthKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesRegenerateAuthKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.RegenAuthKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesRegenerateAuthKeys_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Update Database Migration Service. + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesUpdate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + global::System.Uri.EscapeDataString(sqlMigrationServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update Database Migration Service. + /// + /// Details of SqlMigrationService resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SqlMigrationServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/sqlMigrationServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var sqlMigrationServiceName = _match.Groups["sqlMigrationServiceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataMigration/sqlMigrationServices/" + + sqlMigrationServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SqlMigrationServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of the resource group that contains the resource. You can obtain this value from + /// the Azure Resource Manager API or the portal. + /// Name of the SQL Migration Service. + /// Subscription ID that identifies an Azure subscription. + /// Details of SqlMigrationService resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SqlMigrationServicesUpdate_Validate(string resourceGroupName, string sqlMigrationServiceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(sqlMigrationServiceName),sqlMigrationServiceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksCancel(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/tasks/" + + global::System.Uri.EscapeDataString(taskName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksCancelViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/tasks/(?[^/]+)/cancel$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/tasks/" + + taskName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksCancel_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksCancel_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + } + } + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes + /// a command on a running task. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Command to execute + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksCommand(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/tasks/" + + global::System.Uri.EscapeDataString(taskName) + + "/command" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksCommand_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes + /// a command on a running task. + /// + /// + /// Command to execute + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksCommandViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/tasks/(?[^/]+)/command$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/tasks/" + + taskName + + "/command" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksCommand_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksCommand_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Command to execute + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksCommand_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksCreateOrUpdate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/tasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/tasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/tasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Information about the task + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksCreateOrUpdate_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksDelete(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/tasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Delete the resource even if it contains running tasks + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksDeleteViaIdentity(global::System.String viaIdentity, bool? deleteRunningTasks, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/tasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/tasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == deleteRunningTasks ? global::System.String.Empty : "deleteRunningTasks=" + global::System.Uri.EscapeDataString(deleteRunningTasks.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Delete the resource even if it contains running tasks + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksDelete_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, bool? deleteRunningTasks, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + } + } + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves + /// information about a task. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Expand the response + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksGet(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/tasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves + /// information about a task. + /// + /// + /// Expand the response + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/tasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/tasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Expand the response + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksGet_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Filter tasks by task type + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksList(string subscriptionId, string groupName, string serviceName, string projectName, string taskType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/tasks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(taskType) ? global::System.String.Empty : "taskType=" + global::System.Uri.EscapeDataString(taskType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Filter tasks by task type + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksListViaIdentity(global::System.String viaIdentity, string taskType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/tasks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/tasks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(taskType) ? global::System.String.Empty : "taskType=" + global::System.Uri.EscapeDataString(taskType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TaskList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Filter tasks by task type + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksList_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string taskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(taskType),taskType); + } + } + + /// + /// 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. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksUpdate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.DataMigration/services/" + + global::System.Uri.EscapeDataString(serviceName) + + "/projects/" + + global::System.Uri.EscapeDataString(projectName) + + "/tasks/" + + global::System.Uri.EscapeDataString(taskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Information about the task + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TasksUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DataMigration/services/(?[^/]+)/projects/(?[^/]+)/tasks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var groupName = _match.Groups["groupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var projectName = _match.Groups["projectName"].Value; + var taskName = _match.Groups["taskName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + groupName + + "/providers/Microsoft.DataMigration/services/" + + serviceName + + "/projects/" + + projectName + + "/tasks/" + + taskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TasksUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// Name of the resource group + /// Name of the service + /// Name of the project + /// Name of the Task + /// Information about the task + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TasksUpdate_Validate(string subscriptionId, string groupName, string serviceName, string projectName, string taskName, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask body, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertNotNull(nameof(projectName),projectName); + await eventListener.AssertNotNull(nameof(taskName),taskName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// This method returns region-specific quotas and resource usage information for the Database Migration Service. + /// + /// Subscription ID that identifies an Azure subscription. + /// The Azure region of the operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsagesList(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.DataMigration/locations/" + + global::System.Uri.EscapeDataString(location) + + "/usages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsagesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This method returns region-specific quotas and resource usage information for the Database Migration Service. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsagesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-30-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DataMigration/locations/(?[^/]+)/usages$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.DataMigration/locations/" + + location + + "/usages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsagesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsagesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ApiError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription ID that identifies an Azure subscription. + /// The Azure region of the operation + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsagesList_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(location),location); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Any.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Any.PowerShell.cs new file mode 100644 index 000000000000..4bdef5386a86 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Any.PowerShell.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial class Any + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Any(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Any(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Any(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Any(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial interface IAny + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Any.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Any.TypeConverter.cs new file mode 100644 index 000000000000..f6f94ef96478 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Any.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Any.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Any.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Any.cs b/swaggerci/datamigration/generated/api/Models/Any.cs new file mode 100644 index 000000000000..fa875a122c98 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Any.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Any.json.cs b/swaggerci/datamigration/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..2768a40f9edf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Any.json.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal Any(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new Any(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.PowerShell.cs new file mode 100644 index 000000000000..05ba18ed2aaa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.PowerShell.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Error information. + [System.ComponentModel.TypeConverter(typeof(ApiErrorTypeConverter))] + public partial class ApiError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApiError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApiError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApiError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApiError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error information. + [System.ComponentModel.TypeConverter(typeof(ApiErrorTypeConverter))] + public partial interface IApiError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.TypeConverter.cs new file mode 100644 index 000000000000..3cfc402b1a7d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApiErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApiError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApiError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApiError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.cs new file mode 100644 index 000000000000..09de4ab07636 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Error information. + public partial class ApiError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal + { + + /// + /// The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError' + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)Error).Code = value ?? null; } + + /// Inner errors that caused this error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError _error; + + /// Error information in OData format + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError()); set => this._error = value; } + + /// The human-readable description of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError()); set { {_error = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiErrorInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Creates an new instance. + public ApiError() + { + + } + } + /// Error information. + public partial interface IApiError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError' + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Inner errors that caused this error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inner errors that caused this error", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Detail { get; set; } + /// The human-readable description of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The human-readable description of the error", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Error information. + internal partial interface IApiErrorInternal + + { + /// + /// The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError' + /// + string Code { get; set; } + /// Inner errors that caused this error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Detail { get; set; } + /// Error information in OData format + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError Error { get; set; } + /// The human-readable description of the error + string Message { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.json.cs new file mode 100644 index 000000000000..5ab34cc23b18 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ApiError.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Error information. + public partial class ApiError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ApiError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError.FromJson(__jsonError) : Error;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IApiError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ApiError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.PowerShell.cs new file mode 100644 index 000000000000..2149daf85ea9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// An authentication key. + [System.ComponentModel.TypeConverter(typeof(AuthenticationKeysTypeConverter))] + public partial class AuthenticationKeys + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AuthenticationKeys(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey1 = (string) content.GetValueForProperty("AuthKey1",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey1, global::System.Convert.ToString); + } + if (content.Contains("AuthKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey2 = (string) content.GetValueForProperty("AuthKey2",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey2, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AuthenticationKeys(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey1 = (string) content.GetValueForProperty("AuthKey1",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey1, global::System.Convert.ToString); + } + if (content.Contains("AuthKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey2 = (string) content.GetValueForProperty("AuthKey2",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal)this).AuthKey2, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AuthenticationKeys(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AuthenticationKeys(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An authentication key. + [System.ComponentModel.TypeConverter(typeof(AuthenticationKeysTypeConverter))] + public partial interface IAuthenticationKeys + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.TypeConverter.cs new file mode 100644 index 000000000000..fb2a3d93f7d1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AuthenticationKeysTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AuthenticationKeys.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AuthenticationKeys.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AuthenticationKeys.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.cs new file mode 100644 index 000000000000..329a571b4d54 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An authentication key. + public partial class AuthenticationKeys : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeysInternal + { + + /// Backing field for property. + private string _authKey1; + + /// The first authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AuthKey1 { get => this._authKey1; set => this._authKey1 = value; } + + /// Backing field for property. + private string _authKey2; + + /// The second authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AuthKey2 { get => this._authKey2; set => this._authKey2 = value; } + + /// Creates an new instance. + public AuthenticationKeys() + { + + } + } + /// An authentication key. + public partial interface IAuthenticationKeys : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The first authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The first authentication key.", + SerializedName = @"authKey1", + PossibleTypes = new [] { typeof(string) })] + string AuthKey1 { get; set; } + /// The second authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The second authentication key.", + SerializedName = @"authKey2", + PossibleTypes = new [] { typeof(string) })] + string AuthKey2 { get; set; } + + } + /// An authentication key. + internal partial interface IAuthenticationKeysInternal + + { + /// The first authentication key. + string AuthKey1 { get; set; } + /// The second authentication key. + string AuthKey2 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.json.cs new file mode 100644 index 000000000000..1989b774f165 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AuthenticationKeys.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An authentication key. + public partial class AuthenticationKeys + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal AuthenticationKeys(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authKey1 = If( json?.PropertyT("authKey1"), out var __jsonAuthKey1) ? (string)__jsonAuthKey1 : (string)AuthKey1;} + {_authKey2 = If( json?.PropertyT("authKey2"), out var __jsonAuthKey2) ? (string)__jsonAuthKey2 : (string)AuthKey2;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new AuthenticationKeys(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._authKey1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authKey1.ToString()) : null, "authKey1" ,container.Add ); + AddIf( null != (((object)this._authKey2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authKey2.ToString()) : null, "authKey2" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.PowerShell.cs new file mode 100644 index 000000000000..73dece91ec7d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes the available service SKU. + [System.ComponentModel.TypeConverter(typeof(AvailableServiceSkuTypeConverter))] + public partial class AvailableServiceSku + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AvailableServiceSku(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuFamily = (string) content.GetValueForProperty("SkuFamily",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuFamily, global::System.Convert.ToString); + } + if (content.Contains("SkuSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuSize = (string) content.GetValueForProperty("SkuSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuSize, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("CapacityMinimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMinimum = (int?) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMinimum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CapacityMaximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMaximum = (int?) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMaximum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CapacityDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityDefault = (int?) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityDefault, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CapacityScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability?) content.GetValueForProperty("CapacityScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AvailableServiceSku(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuFamily = (string) content.GetValueForProperty("SkuFamily",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuFamily, global::System.Convert.ToString); + } + if (content.Contains("SkuSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuSize = (string) content.GetValueForProperty("SkuSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuSize, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("CapacityMinimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMinimum = (int?) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMinimum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CapacityMaximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMaximum = (int?) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityMaximum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CapacityDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityDefault = (int?) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityDefault, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CapacityScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability?) content.GetValueForProperty("CapacityScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal)this).CapacityScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AvailableServiceSku(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AvailableServiceSku(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the available service SKU. + [System.ComponentModel.TypeConverter(typeof(AvailableServiceSkuTypeConverter))] + public partial interface IAvailableServiceSku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.TypeConverter.cs new file mode 100644 index 000000000000..63ef8d955667 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AvailableServiceSkuTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AvailableServiceSku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AvailableServiceSku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AvailableServiceSku.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.cs new file mode 100644 index 000000000000..6768d500338d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the available service SKU. + public partial class AvailableServiceSku : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity _capacity; + + /// A description of the scaling capacities of the SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuCapacity()); set => this._capacity = value; } + + /// The default capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).Default = value ?? default(int); } + + /// The maximum capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).Maximum = value ?? default(int); } + + /// The minimum capacity, usually 0 or 1. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).Minimum = value ?? default(int); } + + /// The scalability approach + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability? CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).ScaleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)Capacity).ScaleType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability)""); } + + /// Internal Acessors for Capacity + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuCapacity()); set { {_capacity = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuAutoGenerated()); set { {_sku = value;} } } + + /// Backing field for property. + private string _resourceType; + + /// The resource type, including the provider namespace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; set => this._resourceType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated _sku; + + /// SKU name, tier, etc. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuAutoGenerated()); set => this._sku = value; } + + /// SKU family + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Family; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Family = value ?? null; } + + /// The name of the SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Name = value ?? null; } + + /// SKU size + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Size; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Size = value ?? null; } + + /// The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical" + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)Sku).Tier = value ?? null; } + + /// Creates an new instance. + public AvailableServiceSku() + { + + } + } + /// Describes the available service SKU. + public partial interface IAvailableServiceSku : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The default capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default capacity", + SerializedName = @"default", + PossibleTypes = new [] { typeof(int) })] + int? CapacityDefault { get; set; } + /// The maximum capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum capacity", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(int) })] + int? CapacityMaximum { get; set; } + /// The minimum capacity, usually 0 or 1. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum capacity, usually 0 or 1.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(int) })] + int? CapacityMinimum { get; set; } + /// The scalability approach + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The scalability approach", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability? CapacityScaleType { get; set; } + /// The resource type, including the provider namespace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type, including the provider namespace", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; set; } + /// SKU family + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKU family", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + string SkuFamily { get; set; } + /// The name of the SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the SKU", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; set; } + /// SKU size + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKU size", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string SkuSize { get; set; } + /// The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical" + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tier of the SKU, such as ""Basic"", ""General Purpose"", or ""Business Critical""", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + string SkuTier { get; set; } + + } + /// Describes the available service SKU. + internal partial interface IAvailableServiceSkuInternal + + { + /// A description of the scaling capacities of the SKU + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity Capacity { get; set; } + /// The default capacity + int? CapacityDefault { get; set; } + /// The maximum capacity + int? CapacityMaximum { get; set; } + /// The minimum capacity, usually 0 or 1. + int? CapacityMinimum { get; set; } + /// The scalability approach + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability? CapacityScaleType { get; set; } + /// The resource type, including the provider namespace + string ResourceType { get; set; } + /// SKU name, tier, etc. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated Sku { get; set; } + /// SKU family + string SkuFamily { get; set; } + /// The name of the SKU + string SkuName { get; set; } + /// SKU size + string SkuSize { get; set; } + /// The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical" + string SkuTier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.json.cs new file mode 100644 index 000000000000..647b6c77bd07 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSku.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the available service SKU. + public partial class AvailableServiceSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal AvailableServiceSku(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuAutoGenerated.FromJson(__jsonSku) : Sku;} + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuCapacity.FromJson(__jsonCapacity) : Capacity;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new AvailableServiceSku(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._capacity.ToJson(null,serializationMode) : null, "capacity" ,container.Add ); + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..9e0630830e05 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// SKU name, tier, etc. + [System.ComponentModel.TypeConverter(typeof(AvailableServiceSkuAutoGeneratedTypeConverter))] + public partial class AvailableServiceSkuAutoGenerated + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AvailableServiceSkuAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Tier, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AvailableServiceSkuAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal)this).Tier, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AvailableServiceSkuAutoGenerated(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AvailableServiceSkuAutoGenerated(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// SKU name, tier, etc. + [System.ComponentModel.TypeConverter(typeof(AvailableServiceSkuAutoGeneratedTypeConverter))] + public partial interface IAvailableServiceSkuAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..a5030c565e02 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AvailableServiceSkuAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AvailableServiceSkuAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AvailableServiceSkuAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AvailableServiceSkuAutoGenerated.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.cs new file mode 100644 index 000000000000..0174240ffb0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// SKU name, tier, etc. + public partial class AvailableServiceSkuAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGeneratedInternal + { + + /// Backing field for property. + private string _family; + + /// SKU family + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Family { get => this._family; set => this._family = value; } + + /// Backing field for property. + private string _name; + + /// The name of the SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _size; + + /// SKU size + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Size { get => this._size; set => this._size = value; } + + /// Backing field for property. + private string _tier; + + /// The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical" + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Tier { get => this._tier; set => this._tier = value; } + + /// Creates an new instance. + public AvailableServiceSkuAutoGenerated() + { + + } + } + /// SKU name, tier, etc. + public partial interface IAvailableServiceSkuAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// SKU family + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKU family", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + string Family { get; set; } + /// The name of the SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the SKU", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// SKU size + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKU size", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string Size { get; set; } + /// The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical" + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tier of the SKU, such as ""Basic"", ""General Purpose"", or ""Business Critical""", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + string Tier { get; set; } + + } + /// SKU name, tier, etc. + internal partial interface IAvailableServiceSkuAutoGeneratedInternal + + { + /// SKU family + string Family { get; set; } + /// The name of the SKU + string Name { get; set; } + /// SKU size + string Size { get; set; } + /// The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical" + string Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.json.cs new file mode 100644 index 000000000000..c85d28233c9e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuAutoGenerated.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// SKU name, tier, etc. + public partial class AvailableServiceSkuAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal AvailableServiceSkuAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_family = If( json?.PropertyT("family"), out var __jsonFamily) ? (string)__jsonFamily : (string)Family;} + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)Size;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new AvailableServiceSkuAutoGenerated(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._family)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._family.ToString()) : null, "family" ,container.Add ); + AddIf( null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._size.ToString()) : null, "size" ,container.Add ); + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.PowerShell.cs new file mode 100644 index 000000000000..a2d251b05d9c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A description of the scaling capacities of the SKU + [System.ComponentModel.TypeConverter(typeof(AvailableServiceSkuCapacityTypeConverter))] + public partial class AvailableServiceSkuCapacity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AvailableServiceSkuCapacity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Minimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Minimum = (int?) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Minimum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Maximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Maximum = (int?) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Maximum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Default")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Default = (int?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Default, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).ScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability?) content.GetValueForProperty("ScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).ScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AvailableServiceSkuCapacity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Minimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Minimum = (int?) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Minimum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Maximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Maximum = (int?) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Maximum, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Default")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Default = (int?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).Default, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).ScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability?) content.GetValueForProperty("ScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal)this).ScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AvailableServiceSkuCapacity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AvailableServiceSkuCapacity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A description of the scaling capacities of the SKU + [System.ComponentModel.TypeConverter(typeof(AvailableServiceSkuCapacityTypeConverter))] + public partial interface IAvailableServiceSkuCapacity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.TypeConverter.cs new file mode 100644 index 000000000000..732d9557ebcb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AvailableServiceSkuCapacityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AvailableServiceSkuCapacity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AvailableServiceSkuCapacity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AvailableServiceSkuCapacity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.cs new file mode 100644 index 000000000000..9a80d87a37d3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A description of the scaling capacities of the SKU + public partial class AvailableServiceSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacityInternal + { + + /// Backing field for property. + private int? _default; + + /// The default capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Default { get => this._default; set => this._default = value; } + + /// Backing field for property. + private int? _maximum; + + /// The maximum capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Maximum { get => this._maximum; set => this._maximum = value; } + + /// Backing field for property. + private int? _minimum; + + /// The minimum capacity, usually 0 or 1. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Minimum { get => this._minimum; set => this._minimum = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability? _scaleType; + + /// The scalability approach + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability? ScaleType { get => this._scaleType; set => this._scaleType = value; } + + /// Creates an new instance. + public AvailableServiceSkuCapacity() + { + + } + } + /// A description of the scaling capacities of the SKU + public partial interface IAvailableServiceSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The default capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default capacity", + SerializedName = @"default", + PossibleTypes = new [] { typeof(int) })] + int? Default { get; set; } + /// The maximum capacity + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum capacity", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(int) })] + int? Maximum { get; set; } + /// The minimum capacity, usually 0 or 1. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum capacity, usually 0 or 1.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(int) })] + int? Minimum { get; set; } + /// The scalability approach + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The scalability approach", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability? ScaleType { get; set; } + + } + /// A description of the scaling capacities of the SKU + internal partial interface IAvailableServiceSkuCapacityInternal + + { + /// The default capacity + int? Default { get; set; } + /// The maximum capacity + int? Maximum { get; set; } + /// The minimum capacity, usually 0 or 1. + int? Minimum { get; set; } + /// The scalability approach + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability? ScaleType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.json.cs new file mode 100644 index 000000000000..e3d521fff943 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AvailableServiceSkuCapacity.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A description of the scaling capacities of the SKU + public partial class AvailableServiceSkuCapacity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal AvailableServiceSkuCapacity(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (int?)__jsonMinimum : Minimum;} + {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (int?)__jsonMaximum : Maximum;} + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (int?)__jsonDefault : Default;} + {_scaleType = If( json?.PropertyT("scaleType"), out var __jsonScaleType) ? (string)__jsonScaleType : (string)ScaleType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSkuCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new AvailableServiceSkuCapacity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._minimum ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._minimum) : null, "minimum" ,container.Add ); + AddIf( null != this._maximum ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._maximum) : null, "maximum" ,container.Add ); + AddIf( null != this._default ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._default) : null, "default" ,container.Add ); + AddIf( null != (((object)this._scaleType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._scaleType.ToString()) : null, "scaleType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.PowerShell.cs new file mode 100644 index 000000000000..de6cb061c895 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Azure Active Directory Application + [System.ComponentModel.TypeConverter(typeof(AzureActiveDirectoryAppTypeConverter))] + public partial class AzureActiveDirectoryApp + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureActiveDirectoryApp(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).AppKey = (string) content.GetValueForProperty("AppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).AppKey, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("IgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).IgnoreAzurePermission = (bool?) content.GetValueForProperty("IgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).IgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureActiveDirectoryApp(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).AppKey = (string) content.GetValueForProperty("AppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).AppKey, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("IgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).IgnoreAzurePermission = (bool?) content.GetValueForProperty("IgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)this).IgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureActiveDirectoryApp(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureActiveDirectoryApp(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure Active Directory Application + [System.ComponentModel.TypeConverter(typeof(AzureActiveDirectoryAppTypeConverter))] + public partial interface IAzureActiveDirectoryApp + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.TypeConverter.cs new file mode 100644 index 000000000000..f2930befa978 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureActiveDirectoryAppTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureActiveDirectoryApp.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureActiveDirectoryApp.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureActiveDirectoryApp.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.cs new file mode 100644 index 000000000000..861dacd263d6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Azure Active Directory Application + public partial class AzureActiveDirectoryApp : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal + { + + /// Backing field for property. + private string _appKey; + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AppKey { get => this._appKey; set => this._appKey = value; } + + /// Backing field for property. + private string _applicationId; + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Backing field for property. + private bool? _ignoreAzurePermission; + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IgnoreAzurePermission { get => this._ignoreAzurePermission; set => this._ignoreAzurePermission = value; } + + /// Backing field for property. + private string _tenantId; + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// Creates an new instance. + public AzureActiveDirectoryApp() + { + + } + } + /// Azure Active Directory Application + public partial interface IAzureActiveDirectoryApp : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + string AppKey { get; set; } + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string ApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(bool) })] + bool? IgnoreAzurePermission { get; set; } + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// Azure Active Directory Application + internal partial interface IAzureActiveDirectoryAppInternal + + { + /// Key used to authenticate to the Azure Active Directory Application + string AppKey { get; set; } + /// Application ID of the Azure Active Directory Application + string ApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + bool? IgnoreAzurePermission { get; set; } + /// Tenant id of the customer + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.json.cs new file mode 100644 index 000000000000..ea58b6a9ddc0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureActiveDirectoryApp.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Azure Active Directory Application + public partial class AzureActiveDirectoryApp + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal AzureActiveDirectoryApp(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_applicationId = If( json?.PropertyT("applicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)ApplicationId;} + {_appKey = If( json?.PropertyT("appKey"), out var __jsonAppKey) ? (string)__jsonAppKey : (string)AppKey;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_ignoreAzurePermission = If( json?.PropertyT("ignoreAzurePermissions"), out var __jsonIgnoreAzurePermissions) ? (bool?)__jsonIgnoreAzurePermissions : IgnoreAzurePermission;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new AzureActiveDirectoryApp(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._applicationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._applicationId.ToString()) : null, "applicationId" ,container.Add ); + AddIf( null != (((object)this._appKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._appKey.ToString()) : null, "appKey" ,container.Add ); + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + AddIf( null != this._ignoreAzurePermission ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._ignoreAzurePermission) : null, "ignoreAzurePermissions" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.PowerShell.cs new file mode 100644 index 000000000000..e8541dbb4e8f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Azure Blob Details + [System.ComponentModel.TypeConverter(typeof(AzureBlobTypeConverter))] + public partial class AzureBlob + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureBlob(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).AccountKey = (string) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).AccountKey, global::System.Convert.ToString); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).BlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureBlob(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).AccountKey = (string) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).AccountKey, global::System.Convert.ToString); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)this).BlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureBlob(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureBlob(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure Blob Details + [System.ComponentModel.TypeConverter(typeof(AzureBlobTypeConverter))] + public partial interface IAzureBlob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.TypeConverter.cs new file mode 100644 index 000000000000..35a064902800 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureBlobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureBlob.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureBlob.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureBlob.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.cs new file mode 100644 index 000000000000..3ad88610cc27 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Azure Blob Details + public partial class AzureBlob : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal + { + + /// Backing field for property. + private string _accountKey; + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AccountKey { get => this._accountKey; set => this._accountKey = value; } + + /// Backing field for property. + private string _blobContainerName; + + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string BlobContainerName { get => this._blobContainerName; set => this._blobContainerName = value; } + + /// Backing field for property. + private string _storageAccountResourceId; + + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StorageAccountResourceId { get => this._storageAccountResourceId; set => this._storageAccountResourceId = value; } + + /// Creates an new instance. + public AzureBlob() + { + + } + } + /// Azure Blob Details + public partial interface IAzureBlob : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AccountKey { get; set; } + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string BlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountResourceId { get; set; } + + } + /// Azure Blob Details + internal partial interface IAzureBlobInternal + + { + /// Storage Account Key. + string AccountKey { get; set; } + /// Blob container name where backups are stored. + string BlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + string StorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.json.cs new file mode 100644 index 000000000000..f8beb9922add --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/AzureBlob.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Azure Blob Details + public partial class AzureBlob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal AzureBlob(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageAccountResourceId = If( json?.PropertyT("storageAccountResourceId"), out var __jsonStorageAccountResourceId) ? (string)__jsonStorageAccountResourceId : (string)StorageAccountResourceId;} + {_accountKey = If( json?.PropertyT("accountKey"), out var __jsonAccountKey) ? (string)__jsonAccountKey : (string)AccountKey;} + {_blobContainerName = If( json?.PropertyT("blobContainerName"), out var __jsonBlobContainerName) ? (string)__jsonBlobContainerName : (string)BlobContainerName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new AzureBlob(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._storageAccountResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._storageAccountResourceId.ToString()) : null, "storageAccountResourceId" ,container.Add ); + AddIf( null != (((object)this._accountKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._accountKey.ToString()) : null, "accountKey" ,container.Add ); + AddIf( null != (((object)this._blobContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._blobContainerName.ToString()) : null, "blobContainerName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.PowerShell.cs new file mode 100644 index 000000000000..9f1b02b6f1ad --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.PowerShell.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Backup Configuration + [System.ComponentModel.TypeConverter(typeof(BackupConfigurationTypeConverter))] + public partial class BackupConfiguration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("SourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("TargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("SourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("TargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupConfiguration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupConfiguration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Backup Configuration + [System.ComponentModel.TypeConverter(typeof(BackupConfigurationTypeConverter))] + public partial interface IBackupConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..63cb56167e6f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupConfigurationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.cs new file mode 100644 index 000000000000..73ace0bb7eda --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Backup Configuration + public partial class BackupConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal + { + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlobAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlobAccountKey = value ?? null; } + + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlobContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlobContainerName = value ?? null; } + + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlobStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlobStorageAccountResourceId = value ?? null; } + + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString FileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileSharePassword = value ?? null; } + + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileSharePath = value ?? null; } + + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileShareUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileShareUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileShareUsername = value ?? null; } + + /// Internal Acessors for SourceLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal.SourceLocation { get => (this._sourceLocation = this._sourceLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocation()); set { {_sourceLocation = value;} } } + + /// Internal Acessors for SourceLocationAzureBlob + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal.SourceLocationAzureBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).AzureBlob = value; } + + /// Internal Acessors for SourceLocationFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal.SourceLocationFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileShare = value; } + + /// Internal Acessors for SourceLocationFileStorageType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal.SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileStorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileStorageType = value; } + + /// Internal Acessors for TargetLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal.TargetLocation { get => (this._targetLocation = this._targetLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocation()); set { {_targetLocation = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation _sourceLocation; + + /// Source location of backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation SourceLocation { get => (this._sourceLocation = this._sourceLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocation()); set => this._sourceLocation = value; } + + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)SourceLocation).FileStorageType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation _targetLocation; + + /// Target location for copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation TargetLocation { get => (this._targetLocation = this._targetLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocation()); set => this._targetLocation = value; } + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)TargetLocation).AccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)TargetLocation).AccountKey = value ?? null; } + + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)TargetLocation).StorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)TargetLocation).StorageAccountResourceId = value ?? null; } + + /// Creates an new instance. + public BackupConfiguration() + { + + } + } + /// Backup Configuration + public partial interface IBackupConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobStorageAccountResourceId { get; set; } + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string FileShareUsername { get; set; } + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup storage Type.", + SerializedName = @"fileStorageType", + PossibleTypes = new [] { typeof(string) })] + string SourceLocationFileStorageType { get; } + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationStorageAccountResourceId { get; set; } + + } + /// Backup Configuration + internal partial interface IBackupConfigurationInternal + + { + /// Storage Account Key. + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + string AzureBlobStorageAccountResourceId { get; set; } + /// Password for username to access file share location. + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + string FileShareUsername { get; set; } + /// Source location of backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation SourceLocation { get; set; } + /// Source Azure Blob. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob SourceLocationAzureBlob { get; set; } + /// Source File share. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare SourceLocationFileShare { get; set; } + /// Backup storage Type. + string SourceLocationFileStorageType { get; set; } + /// Target location for copying backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation TargetLocation { get; set; } + /// Storage Account Key. + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + string TargetLocationStorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.json.cs new file mode 100644 index 000000000000..d40f030734be --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupConfiguration.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Backup Configuration + public partial class BackupConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal BackupConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceLocation = If( json?.PropertyT("sourceLocation"), out var __jsonSourceLocation) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocation.FromJson(__jsonSourceLocation) : SourceLocation;} + {_targetLocation = If( json?.PropertyT("targetLocation"), out var __jsonTargetLocation) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocation.FromJson(__jsonTargetLocation) : TargetLocation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new BackupConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceLocation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceLocation.ToJson(null,serializationMode) : null, "sourceLocation" ,container.Add ); + AddIf( null != this._targetLocation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetLocation.ToJson(null,serializationMode) : null, "targetLocation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.PowerShell.cs new file mode 100644 index 000000000000..521395dd5f16 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information of the backup file + [System.ComponentModel.TypeConverter(typeof(BackupFileInfoTypeConverter))] + public partial class BackupFileInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupFileInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FileLocation = (string) content.GetValueForProperty("FileLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FileLocation, global::System.Convert.ToString); + } + if (content.Contains("FamilySequenceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FamilySequenceNumber = (int?) content.GetValueForProperty("FamilySequenceNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FamilySequenceNumber, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupFileInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FileLocation = (string) content.GetValueForProperty("FileLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FileLocation, global::System.Convert.ToString); + } + if (content.Contains("FamilySequenceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FamilySequenceNumber = (int?) content.GetValueForProperty("FamilySequenceNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).FamilySequenceNumber, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupFileInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupFileInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of the backup file + [System.ComponentModel.TypeConverter(typeof(BackupFileInfoTypeConverter))] + public partial interface IBackupFileInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.TypeConverter.cs new file mode 100644 index 000000000000..1cd65d9d7287 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupFileInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupFileInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupFileInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupFileInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.cs new file mode 100644 index 000000000000..d6ae859bc24e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of the backup file + public partial class BackupFileInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfoInternal + { + + /// Backing field for property. + private int? _familySequenceNumber; + + /// Sequence number of the backup file in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? FamilySequenceNumber { get => this._familySequenceNumber; set => this._familySequenceNumber = value; } + + /// Backing field for property. + private string _fileLocation; + + /// Location of the backup file in shared folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FileLocation { get => this._fileLocation; set => this._fileLocation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus? _status; + + /// Status of the backup file during migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public BackupFileInfo() + { + + } + } + /// Information of the backup file + public partial interface IBackupFileInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Sequence number of the backup file in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sequence number of the backup file in the backup set", + SerializedName = @"familySequenceNumber", + PossibleTypes = new [] { typeof(int) })] + int? FamilySequenceNumber { get; set; } + /// Location of the backup file in shared folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of the backup file in shared folder", + SerializedName = @"fileLocation", + PossibleTypes = new [] { typeof(string) })] + string FileLocation { get; set; } + /// Status of the backup file during migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the backup file during migration", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus? Status { get; set; } + + } + /// Information of the backup file + internal partial interface IBackupFileInfoInternal + + { + /// Sequence number of the backup file in the backup set + int? FamilySequenceNumber { get; set; } + /// Location of the backup file in shared folder + string FileLocation { get; set; } + /// Status of the backup file during migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.json.cs new file mode 100644 index 000000000000..85d59dc4ba70 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupFileInfo.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of the backup file + public partial class BackupFileInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal BackupFileInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_fileLocation = If( json?.PropertyT("fileLocation"), out var __jsonFileLocation) ? (string)__jsonFileLocation : (string)FileLocation;} + {_familySequenceNumber = If( json?.PropertyT("familySequenceNumber"), out var __jsonFamilySequenceNumber) ? (int?)__jsonFamilySequenceNumber : FamilySequenceNumber;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new BackupFileInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._fileLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileLocation.ToString()) : null, "fileLocation" ,container.Add ); + AddIf( null != this._familySequenceNumber ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._familySequenceNumber) : null, "familySequenceNumber" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.PowerShell.cs new file mode 100644 index 000000000000..46a9eef90a2e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.PowerShell.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information of backup set + [System.ComponentModel.TypeConverter(typeof(BackupSetInfoTypeConverter))] + public partial class BackupSetInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupSetInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupSetId = (string) content.GetValueForProperty("BackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).FirstLsn = (string) content.GetValueForProperty("FirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).FirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastLsn = (string) content.GetValueForProperty("LastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastLsn, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("BackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("ListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).ListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[]) content.GetValueForProperty("ListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).ListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupStartDate = (global::System.DateTime?) content.GetValueForProperty("BackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupFinishedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupFinishedDate = (global::System.DateTime?) content.GetValueForProperty("BackupFinishedDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupFinishedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).IsBackupRestored = (bool?) content.GetValueForProperty("IsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).IsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupSetInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupSetId = (string) content.GetValueForProperty("BackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).FirstLsn = (string) content.GetValueForProperty("FirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).FirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastLsn = (string) content.GetValueForProperty("LastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastLsn, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("BackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("ListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).ListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[]) content.GetValueForProperty("ListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).ListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupStartDate = (global::System.DateTime?) content.GetValueForProperty("BackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupFinishedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupFinishedDate = (global::System.DateTime?) content.GetValueForProperty("BackupFinishedDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).BackupFinishedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).IsBackupRestored = (bool?) content.GetValueForProperty("IsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)this).IsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupSetInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupSetInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of backup set + [System.ComponentModel.TypeConverter(typeof(BackupSetInfoTypeConverter))] + public partial interface IBackupSetInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.TypeConverter.cs new file mode 100644 index 000000000000..1710bfbb50be --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupSetInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupSetInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupSetInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupSetInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.cs new file mode 100644 index 000000000000..5081bac3884a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of backup set + public partial class BackupSetInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _backupFinishedDate; + + /// Date and time that the backup operation finished + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? BackupFinishedDate { get => this._backupFinishedDate; set => this._backupFinishedDate = value; } + + /// Backing field for property. + private string _backupSetId; + + /// Id for the set of backup files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string BackupSetId { get => this._backupSetId; set => this._backupSetId = value; } + + /// Backing field for property. + private global::System.DateTime? _backupStartDate; + + /// Date and time that the backup operation began + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? BackupStartDate { get => this._backupStartDate; set => this._backupStartDate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? _backupType; + + /// Enum of the different backup types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? BackupType { get => this._backupType; set => this._backupType = value; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database to which the backup set belongs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// Backing field for property. + private string _firstLsn; + + /// First log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FirstLsn { get => this._firstLsn; set => this._firstLsn = value; } + + /// Backing field for property. + private bool? _isBackupRestored; + + /// Whether the backup set is restored or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsBackupRestored { get => this._isBackupRestored; set => this._isBackupRestored = value; } + + /// Backing field for property. + private string _lastLsn; + + /// Last log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LastLsn { get => this._lastLsn; set => this._lastLsn = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Last modified time of the backup file in share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; set => this._lastModifiedTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] _listOfBackupFile; + + /// List of files in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] ListOfBackupFile { get => this._listOfBackupFile; set => this._listOfBackupFile = value; } + + /// Creates an new instance. + public BackupSetInfo() + { + + } + } + /// Information of backup set + public partial interface IBackupSetInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Date and time that the backup operation finished + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time that the backup operation finished", + SerializedName = @"backupFinishedDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BackupFinishedDate { get; set; } + /// Id for the set of backup files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the set of backup files", + SerializedName = @"backupSetId", + PossibleTypes = new [] { typeof(string) })] + string BackupSetId { get; set; } + /// Date and time that the backup operation began + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time that the backup operation began", + SerializedName = @"backupStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BackupStartDate { get; set; } + /// Enum of the different backup types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enum of the different backup types", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? BackupType { get; set; } + /// Name of the database to which the backup set belongs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database to which the backup set belongs", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + /// First log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First log sequence number of the backup file", + SerializedName = @"firstLsn", + PossibleTypes = new [] { typeof(string) })] + string FirstLsn { get; set; } + /// Whether the backup set is restored or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the backup set is restored or not", + SerializedName = @"isBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? IsBackupRestored { get; set; } + /// Last log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last log sequence number of the backup file", + SerializedName = @"lastLsn", + PossibleTypes = new [] { typeof(string) })] + string LastLsn { get; set; } + /// Last modified time of the backup file in share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last modified time of the backup file in share location", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; set; } + /// List of files in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of files in the backup set", + SerializedName = @"listOfBackupFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] ListOfBackupFile { get; set; } + + } + /// Information of backup set + internal partial interface IBackupSetInfoInternal + + { + /// Date and time that the backup operation finished + global::System.DateTime? BackupFinishedDate { get; set; } + /// Id for the set of backup files + string BackupSetId { get; set; } + /// Date and time that the backup operation began + global::System.DateTime? BackupStartDate { get; set; } + /// Enum of the different backup types + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? BackupType { get; set; } + /// Name of the database to which the backup set belongs + string DatabaseName { get; set; } + /// First log sequence number of the backup file + string FirstLsn { get; set; } + /// Whether the backup set is restored or not + bool? IsBackupRestored { get; set; } + /// Last log sequence number of the backup file + string LastLsn { get; set; } + /// Last modified time of the backup file in share location + global::System.DateTime? LastModifiedTime { get; set; } + /// List of files in the backup set + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] ListOfBackupFile { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.json.cs new file mode 100644 index 000000000000..f40476959e92 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BackupSetInfo.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of backup set + public partial class BackupSetInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal BackupSetInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupSetId = If( json?.PropertyT("backupSetId"), out var __jsonBackupSetId) ? (string)__jsonBackupSetId : (string)BackupSetId;} + {_firstLsn = If( json?.PropertyT("firstLsn"), out var __jsonFirstLsn) ? (string)__jsonFirstLsn : (string)FirstLsn;} + {_lastLsn = If( json?.PropertyT("lastLsn"), out var __jsonLastLsn) ? (string)__jsonLastLsn : (string)LastLsn;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + {_backupType = If( json?.PropertyT("backupType"), out var __jsonBackupType) ? (string)__jsonBackupType : (string)BackupType;} + {_listOfBackupFile = If( json?.PropertyT("listOfBackupFiles"), out var __jsonListOfBackupFiles) ? If( __jsonListOfBackupFiles as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfo.FromJson(__u) )) ))() : null : ListOfBackupFile;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_backupStartDate = If( json?.PropertyT("backupStartDate"), out var __jsonBackupStartDate) ? global::System.DateTime.TryParse((string)__jsonBackupStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBackupStartDateValue) ? __jsonBackupStartDateValue : BackupStartDate : BackupStartDate;} + {_backupFinishedDate = If( json?.PropertyT("backupFinishedDate"), out var __jsonBackupFinishedDate) ? global::System.DateTime.TryParse((string)__jsonBackupFinishedDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBackupFinishedDateValue) ? __jsonBackupFinishedDateValue : BackupFinishedDate : BackupFinishedDate;} + {_isBackupRestored = If( json?.PropertyT("isBackupRestored"), out var __jsonIsBackupRestored) ? (bool?)__jsonIsBackupRestored : IsBackupRestored;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new BackupSetInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupSetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupSetId.ToString()) : null, "backupSetId" ,container.Add ); + AddIf( null != (((object)this._firstLsn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._firstLsn.ToString()) : null, "firstLsn" ,container.Add ); + AddIf( null != (((object)this._lastLsn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastLsn.ToString()) : null, "lastLsn" ,container.Add ); + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + AddIf( null != (((object)this._backupType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupType.ToString()) : null, "backupType" ,container.Add ); + if (null != this._listOfBackupFile) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._listOfBackupFile ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("listOfBackupFiles",__w); + } + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AddIf( null != this._backupStartDate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupStartDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupStartDate" ,container.Add ); + AddIf( null != this._backupFinishedDate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupFinishedDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupFinishedDate" ,container.Add ); + AddIf( null != this._isBackupRestored ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isBackupRestored) : null, "isBackupRestored" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.PowerShell.cs new file mode 100644 index 000000000000..8b34a1a471f2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Blob container storage information. + [System.ComponentModel.TypeConverter(typeof(BlobShareTypeConverter))] + public partial class BlobShare + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobShare(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SasUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)this).SasUri = (string) content.GetValueForProperty("SasUri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)this).SasUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobShare(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SasUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)this).SasUri = (string) content.GetValueForProperty("SasUri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)this).SasUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobShare(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobShare(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Blob container storage information. + [System.ComponentModel.TypeConverter(typeof(BlobShareTypeConverter))] + public partial interface IBlobShare + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.TypeConverter.cs new file mode 100644 index 000000000000..9254edd61109 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobShareTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobShare.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobShare.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobShare.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.cs new file mode 100644 index 000000000000..b4b132f3cf49 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Blob container storage information. + public partial class BlobShare : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal + { + + /// Backing field for property. + private string _sasUri; + + /// SAS URI of Azure Storage Account Container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SasUri { get => this._sasUri; set => this._sasUri = value; } + + /// Creates an new instance. + public BlobShare() + { + + } + } + /// Blob container storage information. + public partial interface IBlobShare : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// SAS URI of Azure Storage Account Container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SAS URI of Azure Storage Account Container.", + SerializedName = @"sasUri", + PossibleTypes = new [] { typeof(string) })] + string SasUri { get; set; } + + } + /// Blob container storage information. + internal partial interface IBlobShareInternal + + { + /// SAS URI of Azure Storage Account Container. + string SasUri { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.json.cs new file mode 100644 index 000000000000..872b4a0017a2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/BlobShare.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Blob container storage information. + public partial class BlobShare + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal BlobShare(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sasUri = If( json?.PropertyT("sasUri"), out var __jsonSasUri) ? (string)__jsonSasUri : (string)SasUri;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new BlobShare(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sasUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sasUri.ToString()) : null, "sasUri" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.PowerShell.cs new file mode 100644 index 000000000000..720cf4826655 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the service task to check for OCI drivers. + [System.ComponentModel.TypeConverter(typeof(CheckOciDriverTaskInputTypeConverter))] + public partial class CheckOciDriverTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CheckOciDriverTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInputInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInputInternal)this).ServerVersion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CheckOciDriverTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInputInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInputInternal)this).ServerVersion, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CheckOciDriverTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CheckOciDriverTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the service task to check for OCI drivers. + [System.ComponentModel.TypeConverter(typeof(CheckOciDriverTaskInputTypeConverter))] + public partial interface ICheckOciDriverTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..96f91cbaff4e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CheckOciDriverTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CheckOciDriverTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CheckOciDriverTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CheckOciDriverTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.cs new file mode 100644 index 000000000000..b1dd967ff292 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the service task to check for OCI drivers. + public partial class CheckOciDriverTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInputInternal + { + + /// Backing field for property. + private string _serverVersion; + + /// Version of the source server to check against. Optional. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; set => this._serverVersion = value; } + + /// Creates an new instance. + public CheckOciDriverTaskInput() + { + + } + } + /// Input for the service task to check for OCI drivers. + public partial interface ICheckOciDriverTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Version of the source server to check against. Optional. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the source server to check against. Optional.", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; set; } + + } + /// Input for the service task to check for OCI drivers. + internal partial interface ICheckOciDriverTaskInputInternal + + { + /// Version of the source server to check against. Optional. + string ServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.json.cs new file mode 100644 index 000000000000..cbdaa017ec17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskInput.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the service task to check for OCI drivers. + public partial class CheckOciDriverTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal CheckOciDriverTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new CheckOciDriverTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..c5d7d49b7c14 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output for the service task to check for OCI drivers. + [System.ComponentModel.TypeConverter(typeof(CheckOciDriverTaskOutputTypeConverter))] + public partial class CheckOciDriverTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CheckOciDriverTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InstalledDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriver = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo) content.GetValueForProperty("InstalledDriver",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriver, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleOciDriverInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("InstalledDriverName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverName = (string) content.GetValueForProperty("InstalledDriverName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverName, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSize = (string) content.GetValueForProperty("InstalledDriverSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSize, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverArchiveChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverArchiveChecksum = (string) content.GetValueForProperty("InstalledDriverArchiveChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverArchiveChecksum, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverOracleChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverOracleChecksum = (string) content.GetValueForProperty("InstalledDriverOracleChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverOracleChecksum, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverAssemblyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverAssemblyVersion = (string) content.GetValueForProperty("InstalledDriverAssemblyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverAssemblyVersion, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverSupportedOracleVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSupportedOracleVersion = (string[]) content.GetValueForProperty("InstalledDriverSupportedOracleVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSupportedOracleVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CheckOciDriverTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InstalledDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriver = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo) content.GetValueForProperty("InstalledDriver",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriver, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleOciDriverInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("InstalledDriverName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverName = (string) content.GetValueForProperty("InstalledDriverName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverName, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSize = (string) content.GetValueForProperty("InstalledDriverSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSize, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverArchiveChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverArchiveChecksum = (string) content.GetValueForProperty("InstalledDriverArchiveChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverArchiveChecksum, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverOracleChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverOracleChecksum = (string) content.GetValueForProperty("InstalledDriverOracleChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverOracleChecksum, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverAssemblyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverAssemblyVersion = (string) content.GetValueForProperty("InstalledDriverAssemblyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverAssemblyVersion, global::System.Convert.ToString); + } + if (content.Contains("InstalledDriverSupportedOracleVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSupportedOracleVersion = (string[]) content.GetValueForProperty("InstalledDriverSupportedOracleVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal)this).InstalledDriverSupportedOracleVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CheckOciDriverTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CheckOciDriverTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the service task to check for OCI drivers. + [System.ComponentModel.TypeConverter(typeof(CheckOciDriverTaskOutputTypeConverter))] + public partial interface ICheckOciDriverTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..31a8d4396433 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CheckOciDriverTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CheckOciDriverTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CheckOciDriverTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CheckOciDriverTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.cs new file mode 100644 index 000000000000..1473e84f74a0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the service task to check for OCI drivers. + public partial class CheckOciDriverTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo _installedDriver; + + /// Information about the installed driver if found and valid. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo InstalledDriver { get => (this._installedDriver = this._installedDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleOciDriverInfo()); set => this._installedDriver = value; } + + /// The MD5 Base64 encoded checksum for the driver package. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InstalledDriverArchiveChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).ArchiveChecksum; } + + /// Version listed in the OCI assembly 'oci.dll' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InstalledDriverAssemblyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).AssemblyVersion; } + + /// The name of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InstalledDriverName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).DriverName; } + + /// The checksum for the driver package provided by Oracle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InstalledDriverOracleChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).OracleChecksum; } + + /// The size in bytes of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InstalledDriverSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).DriverSize; } + + /// + /// List of Oracle database versions supported by this driver. Only major minor of the version is listed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] InstalledDriverSupportedOracleVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).SupportedOracleVersion; } + + /// Internal Acessors for InstalledDriver + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.InstalledDriver { get => (this._installedDriver = this._installedDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleOciDriverInfo()); set { {_installedDriver = value;} } } + + /// Internal Acessors for InstalledDriverArchiveChecksum + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.InstalledDriverArchiveChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).ArchiveChecksum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).ArchiveChecksum = value; } + + /// Internal Acessors for InstalledDriverAssemblyVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.InstalledDriverAssemblyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).AssemblyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).AssemblyVersion = value; } + + /// Internal Acessors for InstalledDriverName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.InstalledDriverName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).DriverName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).DriverName = value; } + + /// Internal Acessors for InstalledDriverOracleChecksum + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.InstalledDriverOracleChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).OracleChecksum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).OracleChecksum = value; } + + /// Internal Acessors for InstalledDriverSize + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.InstalledDriverSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).DriverSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).DriverSize = value; } + + /// Internal Acessors for InstalledDriverSupportedOracleVersion + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.InstalledDriverSupportedOracleVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).SupportedOracleVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)InstalledDriver).SupportedOracleVersion = value; } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public CheckOciDriverTaskOutput() + { + + } + } + /// Output for the service task to check for OCI drivers. + public partial interface ICheckOciDriverTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The MD5 Base64 encoded checksum for the driver package. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The MD5 Base64 encoded checksum for the driver package.", + SerializedName = @"archiveChecksum", + PossibleTypes = new [] { typeof(string) })] + string InstalledDriverArchiveChecksum { get; } + /// Version listed in the OCI assembly 'oci.dll' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version listed in the OCI assembly 'oci.dll'", + SerializedName = @"assemblyVersion", + PossibleTypes = new [] { typeof(string) })] + string InstalledDriverAssemblyVersion { get; } + /// The name of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the driver package", + SerializedName = @"driverName", + PossibleTypes = new [] { typeof(string) })] + string InstalledDriverName { get; } + /// The checksum for the driver package provided by Oracle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The checksum for the driver package provided by Oracle.", + SerializedName = @"oracleChecksum", + PossibleTypes = new [] { typeof(string) })] + string InstalledDriverOracleChecksum { get; } + /// The size in bytes of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The size in bytes of the driver package", + SerializedName = @"driverSize", + PossibleTypes = new [] { typeof(string) })] + string InstalledDriverSize { get; } + /// + /// List of Oracle database versions supported by this driver. Only major minor of the version is listed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of Oracle database versions supported by this driver. Only major minor of the version is listed.", + SerializedName = @"supportedOracleVersions", + PossibleTypes = new [] { typeof(string) })] + string[] InstalledDriverSupportedOracleVersion { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the service task to check for OCI drivers. + internal partial interface ICheckOciDriverTaskOutputInternal + + { + /// Information about the installed driver if found and valid. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo InstalledDriver { get; set; } + /// The MD5 Base64 encoded checksum for the driver package. + string InstalledDriverArchiveChecksum { get; set; } + /// Version listed in the OCI assembly 'oci.dll' + string InstalledDriverAssemblyVersion { get; set; } + /// The name of the driver package + string InstalledDriverName { get; set; } + /// The checksum for the driver package provided by Oracle. + string InstalledDriverOracleChecksum { get; set; } + /// The size in bytes of the driver package + string InstalledDriverSize { get; set; } + /// + /// List of Oracle database versions supported by this driver. Only major minor of the version is listed. + /// + string[] InstalledDriverSupportedOracleVersion { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.json.cs new file mode 100644 index 000000000000..44f10bfb44ee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskOutput.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the service task to check for OCI drivers. + public partial class CheckOciDriverTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal CheckOciDriverTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_installedDriver = If( json?.PropertyT("installedDriver"), out var __jsonInstalledDriver) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleOciDriverInfo.FromJson(__jsonInstalledDriver) : InstalledDriver;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new CheckOciDriverTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._installedDriver ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._installedDriver.ToJson(null,serializationMode) : null, "installedDriver" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..6e75dc3f24ef --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that checks for OCI drivers. + [System.ComponentModel.TypeConverter(typeof(CheckOciDriverTaskPropertiesTypeConverter))] + public partial class CheckOciDriverTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CheckOciDriverTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).InputServerVersion = (string) content.GetValueForProperty("InputServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).InputServerVersion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CheckOciDriverTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).InputServerVersion = (string) content.GetValueForProperty("InputServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal)this).InputServerVersion, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CheckOciDriverTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CheckOciDriverTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that checks for OCI drivers. + [System.ComponentModel.TypeConverter(typeof(CheckOciDriverTaskPropertiesTypeConverter))] + public partial interface ICheckOciDriverTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..a58e4f10156e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CheckOciDriverTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CheckOciDriverTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CheckOciDriverTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CheckOciDriverTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.cs new file mode 100644 index 000000000000..c271640af0fc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that checks for OCI drivers. + public partial class CheckOciDriverTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput _input; + + /// Input for the service task to check for OCI drivers. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskInput()); set => this._input = value; } + + /// Version of the source server to check against. Optional. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInputInternal)Input).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInputInternal)Input).ServerVersion = value ?? null; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public CheckOciDriverTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that checks for OCI drivers. + public partial interface ICheckOciDriverTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Version of the source server to check against. Optional. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the source server to check against. Optional.", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string InputServerVersion { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput[] Output { get; } + + } + /// Properties for the task that checks for OCI drivers. + internal partial interface ICheckOciDriverTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Input for the service task to check for OCI drivers. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskInput Input { get; set; } + /// Version of the source server to check against. Optional. + string InputServerVersion { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.json.cs new file mode 100644 index 000000000000..cb3c8b08d21a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CheckOciDriverTaskProperties.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that checks for OCI drivers. + public partial class CheckOciDriverTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal CheckOciDriverTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CheckOciDriverTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICheckOciDriverTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new CheckOciDriverTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.PowerShell.cs new file mode 100644 index 000000000000..a142a00da4ae --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + /// + [System.ComponentModel.TypeConverter(typeof(CommandPropertiesTypeConverter))] + public partial class CommandProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CommandProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CommandProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CommandProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CommandProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + [System.ComponentModel.TypeConverter(typeof(CommandPropertiesTypeConverter))] + public partial interface ICommandProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.TypeConverter.cs new file mode 100644 index 000000000000..f07ecc72db41 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CommandPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CommandProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CommandProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CommandProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.cs new file mode 100644 index 000000000000..ae624d3ad95e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + /// + public partial class CommandProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType _commandType; + + /// Command type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => this._commandType; set => this._commandType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] _error; + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => this._error; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.Error { get => this._error; set { {_error = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.State { get => this._state; set { {_state = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? _state; + + /// The state of the command. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get => this._state; } + + /// Creates an new instance. + public CommandProperties() + { + + } + } + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + public partial interface ICommandProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Command type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Command type.", + SerializedName = @"commandType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get; set; } + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Array of errors. This is ignored if submitted.", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get; } + /// The state of the command. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The state of the command. This is ignored if submitted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get; } + + } + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + internal partial interface ICommandPropertiesInternal + + { + /// Command type. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get; set; } + /// Array of errors. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get; set; } + /// The state of the command. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.json.cs new file mode 100644 index 000000000000..70abb18740e6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CommandProperties.json.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + /// + public partial class CommandProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal CommandProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_commandType = If( json?.PropertyT("commandType"), out var __jsonCommandType) ? (string)__jsonCommandType : (string)CommandType;} + {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? If( __jsonErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError.FromJson(__u) )) ))() : null : Error;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("commandType") ) + { + case "Migrate.Sync.Complete.Database": + { + return new MigrateSyncCompleteCommandProperties(json); + } + case "Migrate.SqlServer.AzureDbSqlMi.Complete": + { + return new MigrateMiSyncCompleteCommandProperties(json); + } + case "cancel": + { + return new MongoDbCancelCommand(json); + } + case "finish": + { + return new MongoDbFinishCommand(json); + } + case "restart": + { + return new MongoDbRestartCommand(json); + } + } + return new CommandProperties(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._commandType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._commandType.ToString()) : null, "commandType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._error) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._error ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("errors",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..eafdc147dc31 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.PowerShell.cs @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates the connection to and provides information about a MongoDB server + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToMongoDbTaskPropertiesTypeConverter))] + public partial class ConnectToMongoDbTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToMongoDbTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbClusterInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputType = (string) content.GetValueForProperty("InputType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputType, global::System.Convert.ToString); + } + if (content.Contains("InputUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputUserName = (string) content.GetValueForProperty("InputUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputUserName, global::System.Convert.ToString); + } + if (content.Contains("InputPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPassword = (string) content.GetValueForProperty("InputPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPassword, global::System.Convert.ToString); + } + if (content.Contains("InputConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputConnectionString = (string) content.GetValueForProperty("InputConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputConnectionString, global::System.Convert.ToString); + } + if (content.Contains("InputDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputDataSource = (string) content.GetValueForProperty("InputDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputDataSource, global::System.Convert.ToString); + } + if (content.Contains("InputEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEncryptConnection = (bool?) content.GetValueForProperty("InputEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerBrandVersion = (string) content.GetValueForProperty("InputServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("InputServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerVersion = (string) content.GetValueForProperty("InputServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerVersion, global::System.Convert.ToString); + } + if (content.Contains("InputServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerName = (string) content.GetValueForProperty("InputServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerName, global::System.Convert.ToString); + } + if (content.Contains("InputTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputTrustServerCertificate = (bool?) content.GetValueForProperty("InputTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputEnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEnforceSsl = (bool?) content.GetValueForProperty("InputEnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPort = (int?) content.GetValueForProperty("InputPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InputAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAdditionalSetting = (string) content.GetValueForProperty("InputAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("InputAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("InputAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToMongoDbTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbClusterInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputType = (string) content.GetValueForProperty("InputType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputType, global::System.Convert.ToString); + } + if (content.Contains("InputUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputUserName = (string) content.GetValueForProperty("InputUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputUserName, global::System.Convert.ToString); + } + if (content.Contains("InputPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPassword = (string) content.GetValueForProperty("InputPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPassword, global::System.Convert.ToString); + } + if (content.Contains("InputConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputConnectionString = (string) content.GetValueForProperty("InputConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputConnectionString, global::System.Convert.ToString); + } + if (content.Contains("InputDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputDataSource = (string) content.GetValueForProperty("InputDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputDataSource, global::System.Convert.ToString); + } + if (content.Contains("InputEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEncryptConnection = (bool?) content.GetValueForProperty("InputEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerBrandVersion = (string) content.GetValueForProperty("InputServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("InputServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerVersion = (string) content.GetValueForProperty("InputServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerVersion, global::System.Convert.ToString); + } + if (content.Contains("InputServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerName = (string) content.GetValueForProperty("InputServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputServerName, global::System.Convert.ToString); + } + if (content.Contains("InputTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputTrustServerCertificate = (bool?) content.GetValueForProperty("InputTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputEnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEnforceSsl = (bool?) content.GetValueForProperty("InputEnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputEnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPort = (int?) content.GetValueForProperty("InputPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InputAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAdditionalSetting = (string) content.GetValueForProperty("InputAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("InputAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("InputAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal)this).InputAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToMongoDbTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToMongoDbTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates the connection to and provides information about a MongoDB server + [System.ComponentModel.TypeConverter(typeof(ConnectToMongoDbTaskPropertiesTypeConverter))] + public partial interface IConnectToMongoDbTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..e43563618b7b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToMongoDbTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToMongoDbTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToMongoDbTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToMongoDbTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.cs new file mode 100644 index 000000000000..7e51e3d0490b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.cs @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates the connection to and provides information about a MongoDB server + /// + public partial class ConnectToMongoDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo _input; + + /// Describes a connection to a MongoDB data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo()); set => this._input = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? InputAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ConnectionString = value ?? null; } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).EncryptConnection = value ?? default(bool); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputEnforceSsl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).EnforceSsl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).EnforceSsl = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Input).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Input).Password = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? InputPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).Port = value ?? default(int); } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Input).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Input).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Input).Type = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Input).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Input).UserName = value ?? null; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo()); set { {_input = value;} } } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo[] _output; + + /// An array containing a single MongoDbClusterInfo object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToMongoDbTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates the connection to and provides information about a MongoDB server + public partial interface IConnectToMongoDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string InputAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? InputAuthentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName and password properties", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string InputConnectionString { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string InputDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? InputEncryptConnection { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"enforceSSL", + PossibleTypes = new [] { typeof(bool) })] + bool? InputEnforceSsl { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string InputPassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? InputPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string InputServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string InputServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string InputServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? InputTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string InputType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string InputUserName { get; set; } + /// An array containing a single MongoDbClusterInfo object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An array containing a single MongoDbClusterInfo object", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo[] Output { get; } + + } + /// Properties for the task that validates the connection to and provides information about a MongoDB server + internal partial interface IConnectToMongoDbTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Describes a connection to a MongoDB data source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Input { get; set; } + /// Additional connection settings + string InputAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? InputAuthentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + string InputConnectionString { get; set; } + /// Data source + string InputDataSource { get; set; } + /// Whether to encrypt the connection + bool? InputEncryptConnection { get; set; } + + bool? InputEnforceSsl { get; set; } + /// Password credential. + string InputPassword { get; set; } + /// port for server + int? InputPort { get; set; } + /// server brand version + string InputServerBrandVersion { get; set; } + /// name of the server + string InputServerName { get; set; } + /// server version + string InputServerVersion { get; set; } + /// Whether to trust the server certificate + bool? InputTrustServerCertificate { get; set; } + /// Type of connection info + string InputType { get; set; } + /// User name + string InputUserName { get; set; } + /// An array containing a single MongoDbClusterInfo object + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.json.cs new file mode 100644 index 000000000000..5f03d6bc08ba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToMongoDbTaskProperties.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates the connection to and provides information about a MongoDB server + /// + public partial class ConnectToMongoDbTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToMongoDbTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbClusterInfo.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToMongoDbTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToMongoDbTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.PowerShell.cs new file mode 100644 index 000000000000..4463bc2aa546 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.PowerShell.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the task that validates MySQL database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceMySqlTaskInputTypeConverter))] + public partial class ConnectToSourceMySqlTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceMySqlTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).TargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType?) content.GetValueForProperty("TargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).TargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType.CreateFrom); + } + if (content.Contains("CheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).CheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("CheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).CheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("IsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).IsOfflineMigration = (bool?) content.GetValueForProperty("IsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).IsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceMySqlTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).TargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType?) content.GetValueForProperty("TargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).TargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType.CreateFrom); + } + if (content.Contains("CheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).CheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("CheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).CheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("IsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).IsOfflineMigration = (bool?) content.GetValueForProperty("IsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).IsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceMySqlTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceMySqlTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates MySQL database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceMySqlTaskInputTypeConverter))] + public partial interface IConnectToSourceMySqlTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..e3157ebbc036 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceMySqlTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceMySqlTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceMySqlTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceMySqlTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.cs new file mode 100644 index 000000000000..ef15714b3e26 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that validates MySQL database connection + public partial class ConnectToSourceMySqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? _checkPermissionsGroup; + + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? CheckPermissionsGroup { get => this._checkPermissionsGroup; set => this._checkPermissionsGroup = value; } + + /// Backing field for property. + private bool? _isOfflineMigration; + + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsOfflineMigration { get => this._isOfflineMigration; set => this._isOfflineMigration = value; } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _sourceConnectionInfo; + + /// Information for connecting to MySQL source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType? _targetPlatform; + + /// Target Platform for the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType? TargetPlatform { get => this._targetPlatform; set => this._targetPlatform = value; } + + /// Creates an new instance. + public ConnectToSourceMySqlTaskInput() + { + + } + } + /// Input for the task that validates MySQL database connection + public partial interface IConnectToSourceMySqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Permission group for validations", + SerializedName = @"checkPermissionsGroup", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? CheckPermissionsGroup { get; set; } + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether or not the migration is offline", + SerializedName = @"isOfflineMigration", + PossibleTypes = new [] { typeof(bool) })] + bool? IsOfflineMigration { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int SourceConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Target Platform for the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target Platform for the migration", + SerializedName = @"targetPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType? TargetPlatform { get; set; } + + } + /// Input for the task that validates MySQL database connection + internal partial interface IConnectToSourceMySqlTaskInputInternal + + { + /// Permission group for validations + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? CheckPermissionsGroup { get; set; } + /// Flag for whether or not the migration is offline + bool? IsOfflineMigration { get; set; } + /// Information for connecting to MySQL source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int SourceConnectionInfoPort { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Target Platform for the migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType? TargetPlatform { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.json.cs new file mode 100644 index 000000000000..06f81170ae29 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskInput.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that validates MySQL database connection + public partial class ConnectToSourceMySqlTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceMySqlTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetPlatform = If( json?.PropertyT("targetPlatform"), out var __jsonTargetPlatform) ? (string)__jsonTargetPlatform : (string)TargetPlatform;} + {_checkPermissionsGroup = If( json?.PropertyT("checkPermissionsGroup"), out var __jsonCheckPermissionsGroup) ? (string)__jsonCheckPermissionsGroup : (string)CheckPermissionsGroup;} + {_isOfflineMigration = If( json?.PropertyT("isOfflineMigration"), out var __jsonIsOfflineMigration) ? (bool?)__jsonIsOfflineMigration : IsOfflineMigration;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceMySqlTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != (((object)this._targetPlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetPlatform.ToString()) : null, "targetPlatform" ,container.Add ); + AddIf( null != (((object)this._checkPermissionsGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._checkPermissionsGroup.ToString()) : null, "checkPermissionsGroup" ,container.Add ); + AddIf( null != this._isOfflineMigration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isOfflineMigration) : null, "isOfflineMigration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..8189123734ea --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.PowerShell.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that validates MySQL database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceMySqlTaskPropertiesTypeConverter))] + public partial class ConnectToSourceMySqlTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceMySqlTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceNonSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputTargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType?) content.GetValueForProperty("InputTargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputTargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType.CreateFrom); + } + if (content.Contains("InputCheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputCheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("InputCheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputCheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("InputIsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputIsOfflineMigration = (bool?) content.GetValueForProperty("InputIsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputIsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceMySqlTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceNonSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputTargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType?) content.GetValueForProperty("InputTargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputTargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType.CreateFrom); + } + if (content.Contains("InputCheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputCheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("InputCheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputCheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("InputIsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputIsOfflineMigration = (bool?) content.GetValueForProperty("InputIsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).InputIsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceMySqlTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceMySqlTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates MySQL database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceMySqlTaskPropertiesTypeConverter))] + public partial interface IConnectToSourceMySqlTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..f0b11d13d2a5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceMySqlTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceMySqlTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceMySqlTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceMySqlTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.cs new file mode 100644 index 000000000000..78fcb2433e6b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that validates MySQL database connection + public partial class ConnectToSourceMySqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskInput()); set => this._input = value; } + + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).CheckPermissionsGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).CheckPermissionsGroup = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup)""); } + + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputIsOfflineMigration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).IsOfflineMigration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).IsOfflineMigration = value ?? default(bool); } + + /// Target Platform for the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType? InputTargetPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).TargetPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).TargetPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType)""); } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputSourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal.InputSourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput[] Output { get => this._output; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoPort = value ?? default(int); } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoServerName = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInputInternal)Input).SourceConnectionInfoUserName = value ?? null; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToSourceMySqlTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates MySQL database connection + public partial interface IConnectToSourceMySqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Permission group for validations", + SerializedName = @"checkPermissionsGroup", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get; set; } + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether or not the migration is offline", + SerializedName = @"isOfflineMigration", + PossibleTypes = new [] { typeof(bool) })] + bool? InputIsOfflineMigration { get; set; } + /// Target Platform for the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target Platform for the migration", + SerializedName = @"targetPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType? InputTargetPlatform { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates MySQL database connection + internal partial interface IConnectToSourceMySqlTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskInput Input { get; set; } + /// Permission group for validations + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get; set; } + /// Flag for whether or not the migration is offline + bool? InputIsOfflineMigration { get; set; } + /// Information for connecting to MySQL source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo InputSourceConnectionInfo { get; set; } + /// Target Platform for the migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType? InputTargetPlatform { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput[] Output { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.json.cs new file mode 100644 index 000000000000..68880f859356 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceMySqlTaskProperties.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that validates MySQL database connection + public partial class ConnectToSourceMySqlTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceMySqlTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceMySqlTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceNonSqlTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceMySqlTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceMySqlTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..cdd4215f43b7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output for connect to MySQL type source + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceNonSqlTaskOutputTypeConverter))] + public partial class ConnectToSourceNonSqlTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceNonSqlTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties) content.GetValueForProperty("ServerProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerProperty, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("ServerPropertyServerPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerPlatform = (string) content.GetValueForProperty("ServerPropertyServerPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerPlatform, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerName = (string) content.GetValueForProperty("ServerPropertyServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerName, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerVersion = (string) content.GetValueForProperty("ServerPropertyServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerEdition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerEdition = (string) content.GetValueForProperty("ServerPropertyServerEdition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerEdition, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerOperatingSystemVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerOperatingSystemVersion = (string) content.GetValueForProperty("ServerPropertyServerOperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerOperatingSystemVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerDatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerDatabaseCount = (int?) content.GetValueForProperty("ServerPropertyServerDatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerDatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceNonSqlTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties) content.GetValueForProperty("ServerProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerProperty, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("ServerPropertyServerPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerPlatform = (string) content.GetValueForProperty("ServerPropertyServerPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerPlatform, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerName = (string) content.GetValueForProperty("ServerPropertyServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerName, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerVersion = (string) content.GetValueForProperty("ServerPropertyServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerEdition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerEdition = (string) content.GetValueForProperty("ServerPropertyServerEdition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerEdition, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerOperatingSystemVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerOperatingSystemVersion = (string) content.GetValueForProperty("ServerPropertyServerOperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerOperatingSystemVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerPropertyServerDatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerDatabaseCount = (int?) content.GetValueForProperty("ServerPropertyServerDatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal)this).ServerPropertyServerDatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceNonSqlTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceNonSqlTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for connect to MySQL type source + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceNonSqlTaskOutputTypeConverter))] + public partial interface IConnectToSourceNonSqlTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..43f5a8a9338b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceNonSqlTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceNonSqlTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceNonSqlTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceNonSqlTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.cs new file mode 100644 index 000000000000..8e026854e25b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for connect to MySQL type source + public partial class ConnectToSourceNonSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal + { + + /// Backing field for property. + private string[] _database; + + /// List of databases on the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Database { get => this._database; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Database + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for ServerProperty + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ServerProperty { get => (this._serverProperty = this._serverProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServerProperties()); set { {_serverProperty = value;} } } + + /// Internal Acessors for ServerPropertyServerDatabaseCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ServerPropertyServerDatabaseCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerDatabaseCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerDatabaseCount = value; } + + /// Internal Acessors for ServerPropertyServerEdition + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ServerPropertyServerEdition { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerEdition; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerEdition = value; } + + /// Internal Acessors for ServerPropertyServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ServerPropertyServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerName = value; } + + /// Internal Acessors for ServerPropertyServerOperatingSystemVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ServerPropertyServerOperatingSystemVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerOperatingSystemVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerOperatingSystemVersion = value; } + + /// Internal Acessors for ServerPropertyServerPlatform + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ServerPropertyServerPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerPlatform = value; } + + /// Internal Acessors for ServerPropertyServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ServerPropertyServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerVersion = value; } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties _serverProperty; + + /// Server properties + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties ServerProperty { get => (this._serverProperty = this._serverProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServerProperties()); } + + /// Number of databases in the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ServerPropertyServerDatabaseCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerDatabaseCount; } + + /// Edition of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ServerPropertyServerEdition { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerEdition; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ServerPropertyServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerName; } + + /// Version of the operating system + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ServerPropertyServerOperatingSystemVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerOperatingSystemVersion; } + + /// Name of the server platform + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ServerPropertyServerPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerPlatform; } + + /// Version of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ServerPropertyServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)ServerProperty).ServerVersion; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public ConnectToSourceNonSqlTaskOutput() + { + + } + } + /// Output for connect to MySQL type source + public partial interface IConnectToSourceNonSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of databases on the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of databases on the server", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string[] Database { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Number of databases in the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of databases in the server", + SerializedName = @"serverDatabaseCount", + PossibleTypes = new [] { typeof(int) })] + int? ServerPropertyServerDatabaseCount { get; } + /// Edition of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Edition of the database server", + SerializedName = @"serverEdition", + PossibleTypes = new [] { typeof(string) })] + string ServerPropertyServerEdition { get; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerPropertyServerName { get; } + /// Version of the operating system + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the operating system", + SerializedName = @"serverOperatingSystemVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerPropertyServerOperatingSystemVersion { get; } + /// Name of the server platform + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the server platform", + SerializedName = @"serverPlatform", + PossibleTypes = new [] { typeof(string) })] + string ServerPropertyServerPlatform { get; } + /// Version of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the database server", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerPropertyServerVersion { get; } + /// Server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for connect to MySQL type source + internal partial interface IConnectToSourceNonSqlTaskOutputInternal + + { + /// List of databases on the server + string[] Database { get; set; } + /// Result identifier + string Id { get; set; } + /// Server properties + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties ServerProperty { get; set; } + /// Number of databases in the server + int? ServerPropertyServerDatabaseCount { get; set; } + /// Edition of the database server + string ServerPropertyServerEdition { get; set; } + /// Name of the server + string ServerPropertyServerName { get; set; } + /// Version of the operating system + string ServerPropertyServerOperatingSystemVersion { get; set; } + /// Name of the server platform + string ServerPropertyServerPlatform { get; set; } + /// Version of the database server + string ServerPropertyServerVersion { get; set; } + /// Server brand version + string SourceServerBrandVersion { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.json.cs new file mode 100644 index 000000000000..4f0470ee6399 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceNonSqlTaskOutput.json.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for connect to MySQL type source + public partial class ConnectToSourceNonSqlTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceNonSqlTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serverProperty = If( json?.PropertyT("serverProperties"), out var __jsonServerProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServerProperties.FromJson(__jsonServerProperties) : ServerProperty;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? If( __jsonDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Database;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceNonSqlTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceNonSqlTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._serverProperty ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._serverProperty.ToJson(null,serializationMode) : null, "serverProperties" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._database) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._database ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("databases",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..6cd08383a255 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the task that validates Oracle database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceOracleSyncTaskInputTypeConverter))] + public partial class ConnectToSourceOracleSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceOracleSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceOracleSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceOracleSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceOracleSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates Oracle database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceOracleSyncTaskInputTypeConverter))] + public partial interface IConnectToSourceOracleSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..f5bdf10dd1a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceOracleSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceOracleSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceOracleSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceOracleSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.cs new file mode 100644 index 000000000000..f3dd579bb610 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that validates Oracle database connection + public partial class ConnectToSourceOracleSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo _sourceConnectionInfo; + + /// Information for connecting to Oracle source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public ConnectToSourceOracleSyncTaskInput() + { + + } + } + /// Input for the task that validates Oracle database connection + public partial interface IConnectToSourceOracleSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"EZConnect or TNSName connection string.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates Oracle database connection + internal partial interface IConnectToSourceOracleSyncTaskInputInternal + + { + /// Information for connecting to Oracle source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo SourceConnectionInfo { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + string SourceConnectionInfoDataSource { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// port for server + int? SourceConnectionInfoPort { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.json.cs new file mode 100644 index 000000000000..d09a6ed0f77a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskInput.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that validates Oracle database connection + public partial class ConnectToSourceOracleSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceOracleSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceOracleSyncTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..858fc6e57e6a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output for the task that validates Oracle database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceOracleSyncTaskOutputTypeConverter))] + public partial class ConnectToSourceOracleSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceOracleSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceOracleSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceOracleSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceOracleSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates Oracle database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceOracleSyncTaskOutputTypeConverter))] + public partial interface IConnectToSourceOracleSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..3ceffe99bb69 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceOracleSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceOracleSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceOracleSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceOracleSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.cs new file mode 100644 index 000000000000..9531e70f88e8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the task that validates Oracle database connection + public partial class ConnectToSourceOracleSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal + { + + /// Backing field for property. + private string[] _database; + + /// List of schemas on source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Database { get => this._database; } + + /// Internal Acessors for Database + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Version of the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public ConnectToSourceOracleSyncTaskOutput() + { + + } + } + /// Output for the task that validates Oracle database connection + public partial interface IConnectToSourceOracleSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of schemas on source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of schemas on source server", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string[] Database { get; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Version of the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the source server", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that validates Oracle database connection + internal partial interface IConnectToSourceOracleSyncTaskOutputInternal + + { + /// List of schemas on source server + string[] Database { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Version of the source server + string SourceServerVersion { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.json.cs new file mode 100644 index 000000000000..20927795c9d9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskOutput.json.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the task that validates Oracle database connection + public partial class ConnectToSourceOracleSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceOracleSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? If( __jsonDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Database;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceOracleSyncTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._database) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._database ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("databases",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..5f7d7f1796e8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.PowerShell.cs @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that validates Oracle database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceOracleSyncTaskPropertiesTypeConverter))] + public partial class ConnectToSourceOracleSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceOracleSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceOracleSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceOracleSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceOracleSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates Oracle database connection + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceOracleSyncTaskPropertiesTypeConverter))] + public partial interface IConnectToSourceOracleSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..bf298fae7269 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceOracleSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceOracleSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceOracleSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceOracleSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.cs new file mode 100644 index 000000000000..834f5be4dad7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that validates Oracle database connection + public partial class ConnectToSourceOracleSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputSourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal.InputSourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput[] Output { get => this._output; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoDataSource = value ?? null; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoPassword = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoPort = value ?? default(int); } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoServerVersion = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInputInternal)Input).SourceConnectionInfoUserName = value ?? null; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToSourceOracleSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates Oracle database connection + public partial interface IConnectToSourceOracleSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput[] Output { get; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"EZConnect or TNSName connection string.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates Oracle database connection + internal partial interface IConnectToSourceOracleSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskInput Input { get; set; } + /// Information for connecting to Oracle source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo InputSourceConnectionInfo { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput[] Output { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + string SourceConnectionInfoDataSource { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// port for server + int? SourceConnectionInfoPort { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.json.cs new file mode 100644 index 000000000000..e6c4fb627071 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceOracleSyncTaskProperties.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that validates Oracle database connection + public partial class ConnectToSourceOracleSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceOracleSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceOracleSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceOracleSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceOracleSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..cf1e080d62ae --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.PowerShell.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to PostgreSQL and source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourcePostgreSqlSyncTaskInputTypeConverter))] + public partial class ConnectToSourcePostgreSqlSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourcePostgreSqlSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourcePostgreSqlSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourcePostgreSqlSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourcePostgreSqlSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to PostgreSQL and source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourcePostgreSqlSyncTaskInputTypeConverter))] + public partial interface IConnectToSourcePostgreSqlSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..3626b7959bbc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourcePostgreSqlSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourcePostgreSqlSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourcePostgreSqlSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourcePostgreSqlSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.cs new file mode 100644 index 000000000000..228b317b7fc9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to PostgreSQL and source server requirements + /// + public partial class ConnectToSourcePostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source PostgreSQL server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public ConnectToSourcePostgreSqlSyncTaskInput() + { + + } + } + /// Input for the task that validates connection to PostgreSQL and source server requirements + public partial interface IConnectToSourcePostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int SourceConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates connection to PostgreSQL and source server requirements + internal partial interface IConnectToSourcePostgreSqlSyncTaskInputInternal + + { + /// Connection information for source PostgreSQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int SourceConnectionInfoPort { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.json.cs new file mode 100644 index 000000000000..5752e51949bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskInput.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to PostgreSQL and source server requirements + /// + public partial class ConnectToSourcePostgreSqlSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourcePostgreSqlSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourcePostgreSqlSyncTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..5a2a6502f1aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to PostgreSQL and source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourcePostgreSqlSyncTaskOutputTypeConverter))] + public partial class ConnectToSourcePostgreSqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourcePostgreSqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourcePostgreSqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourcePostgreSqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourcePostgreSqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to PostgreSQL and source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourcePostgreSqlSyncTaskOutputTypeConverter))] + public partial interface IConnectToSourcePostgreSqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..eda0f7119991 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourcePostgreSqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourcePostgreSqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourcePostgreSqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourcePostgreSqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.cs new file mode 100644 index 000000000000..1d6ea05db15f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to PostgreSQL and source server requirements + /// + public partial class ConnectToSourcePostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal + { + + /// Backing field for property. + private string[] _database; + + /// List of databases on source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Database { get => this._database; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Database + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Version of the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public ConnectToSourcePostgreSqlSyncTaskOutput() + { + + } + } + /// Output for the task that validates connection to PostgreSQL and source server requirements + public partial interface IConnectToSourcePostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of databases on source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of databases on source server", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string[] Database { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Version of the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the source server", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that validates connection to PostgreSQL and source server requirements + internal partial interface IConnectToSourcePostgreSqlSyncTaskOutputInternal + + { + /// List of databases on source server + string[] Database { get; set; } + /// Result identifier + string Id { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Version of the source server + string SourceServerVersion { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..59dcd43870c1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskOutput.json.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to PostgreSQL and source server requirements + /// + public partial class ConnectToSourcePostgreSqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourcePostgreSqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? If( __jsonDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Database;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourcePostgreSqlSyncTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._database) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._database ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("databases",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..1257e5b0e5aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to PostgreSQL server and source server requirements for online migration + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourcePostgreSqlSyncTaskPropertiesTypeConverter))] + public partial class ConnectToSourcePostgreSqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourcePostgreSqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourcePostgreSqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourcePostgreSqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourcePostgreSqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to PostgreSQL server and source server requirements for online migration + [System.ComponentModel.TypeConverter(typeof(ConnectToSourcePostgreSqlSyncTaskPropertiesTypeConverter))] + public partial interface IConnectToSourcePostgreSqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..18d97d7c014d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourcePostgreSqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourcePostgreSqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourcePostgreSqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourcePostgreSqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.cs new file mode 100644 index 000000000000..e6cc266dc7c9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to PostgreSQL server and source server requirements for online migration + /// + public partial class ConnectToSourcePostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputSourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal.InputSourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput[] Output { get => this._output; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoDataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoDatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoPort = value ?? default(int); } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInputInternal)Input).SourceConnectionInfoUserName = value ?? null; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public ConnectToSourcePostgreSqlSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to PostgreSQL server and source server requirements for online migration + public partial interface IConnectToSourcePostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates connection to PostgreSQL server and source server requirements for online migration + internal partial interface IConnectToSourcePostgreSqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskInput Input { get; set; } + /// Connection information for source PostgreSQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo InputSourceConnectionInfo { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput[] Output { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..b61473ff933f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourcePostgreSqlSyncTaskProperties.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to PostgreSQL server and source server requirements for online migration + /// + public partial class ConnectToSourcePostgreSqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourcePostgreSqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourcePostgreSqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourcePostgreSqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourcePostgreSqlSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..18083ce19457 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.PowerShell.cs @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to SQL Server and source server requirements for online migration + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerSyncTaskPropertiesTypeConverter))] + public partial class ConnectToSourceSqlServerSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputCheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("InputCheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("InputCollectDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectDatabase = (bool?) content.GetValueForProperty("InputCollectDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectDatabase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectLogin = (bool?) content.GetValueForProperty("InputCollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectAgentJob = (bool?) content.GetValueForProperty("InputCollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectTdeCertificateInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectTdeCertificateInfo = (bool?) content.GetValueForProperty("InputCollectTdeCertificateInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectTdeCertificateInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("InputValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputEncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputEncryptedKeyForSecureField = (string) content.GetValueForProperty("InputEncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputEncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputCheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("InputCheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("InputCollectDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectDatabase = (bool?) content.GetValueForProperty("InputCollectDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectDatabase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectLogin = (bool?) content.GetValueForProperty("InputCollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectAgentJob = (bool?) content.GetValueForProperty("InputCollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectTdeCertificateInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectTdeCertificateInfo = (bool?) content.GetValueForProperty("InputCollectTdeCertificateInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputCollectTdeCertificateInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("InputValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputEncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputEncryptedKeyForSecureField = (string) content.GetValueForProperty("InputEncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).InputEncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to SQL Server and source server requirements for online migration + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerSyncTaskPropertiesTypeConverter))] + public partial interface IConnectToSourceSqlServerSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..f1f2fdf6ca21 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.cs new file mode 100644 index 000000000000..048465566c0c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL Server and source server requirements for online migration + /// + public partial class ConnectToSourceSqlServerSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput()); set => this._input = value; } + + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CheckPermissionsGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CheckPermissionsGroup = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup)""); } + + /// Flag for whether to collect agent jobs from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectAgentJob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectAgentJob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectAgentJob = value ?? default(bool); } + + /// Flag for whether to collect databases from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectDatabase = value ?? default(bool); } + + /// Flag for whether to collect logins from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectLogin { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectLogin; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectLogin = value ?? default(bool); } + + /// Flag for whether to collect TDE Certificate names from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectTdeCertificateInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectTdeCertificateInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectTdeCertificateInfo = value ?? default(bool); } + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputEncryptedKeyForSecureField { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).EncryptedKeyForSecureField; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).EncryptedKeyForSecureField = value ?? null; } + + /// Flag for whether to validate SSIS catalog is reachable on the source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputValidateSsisCatalogOnly { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).ValidateSsisCatalogOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).ValidateSsisCatalogOnly = value ?? default(bool); } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputSourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal.InputSourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Output { get => this._output; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoUserName = value ?? null; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public ConnectToSourceSqlServerSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to SQL Server and source server requirements for online migration + public partial interface IConnectToSourceSqlServerSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Permission group for validations", + SerializedName = @"checkPermissionsGroup", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get; set; } + /// Flag for whether to collect agent jobs from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect agent jobs from source server.", + SerializedName = @"collectAgentJobs", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectAgentJob { get; set; } + /// Flag for whether to collect databases from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect databases from source server.", + SerializedName = @"collectDatabases", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectDatabase { get; set; } + /// Flag for whether to collect logins from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect logins from source server.", + SerializedName = @"collectLogins", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectLogin { get; set; } + /// Flag for whether to collect TDE Certificate names from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect TDE Certificate names from source server.", + SerializedName = @"collectTdeCertificateInfo", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectTdeCertificateInfo { get; set; } + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string InputEncryptedKeyForSecureField { get; set; } + /// Flag for whether to validate SSIS catalog is reachable on the source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to validate SSIS catalog is reachable on the source server.", + SerializedName = @"validateSsisCatalogOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? InputValidateSsisCatalogOnly { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates connection to SQL Server and source server requirements for online migration + internal partial interface IConnectToSourceSqlServerSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput Input { get; set; } + /// Permission group for validations + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get; set; } + /// Flag for whether to collect agent jobs from source server. + bool? InputCollectAgentJob { get; set; } + /// Flag for whether to collect databases from source server. + bool? InputCollectDatabase { get; set; } + /// Flag for whether to collect logins from source server. + bool? InputCollectLogin { get; set; } + /// Flag for whether to collect TDE Certificate names from source server. + bool? InputCollectTdeCertificateInfo { get; set; } + /// encrypted key for secure fields + string InputEncryptedKeyForSecureField { get; set; } + /// Connection information for Source SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo InputSourceConnectionInfo { get; set; } + /// Flag for whether to validate SSIS catalog is reachable on the source server. + bool? InputValidateSsisCatalogOnly { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Output { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.json.cs new file mode 100644 index 000000000000..f3f2d6df26b0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerSyncTaskProperties.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL Server and source server requirements for online migration + /// + public partial class ConnectToSourceSqlServerSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceSqlServerSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.PowerShell.cs new file mode 100644 index 000000000000..ad3d52955bbc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.PowerShell.cs @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to SQL Server and also validates source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskInputTypeConverter))] + public partial class ConnectToSourceSqlServerTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("CheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("CollectDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectDatabase = (bool?) content.GetValueForProperty("CollectDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectDatabase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectLogin = (bool?) content.GetValueForProperty("CollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectAgentJob = (bool?) content.GetValueForProperty("CollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectTdeCertificateInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectTdeCertificateInfo = (bool?) content.GetValueForProperty("CollectTdeCertificateInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectTdeCertificateInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).ValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("ValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).ValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("CheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("CollectDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectDatabase = (bool?) content.GetValueForProperty("CollectDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectDatabase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectLogin = (bool?) content.GetValueForProperty("CollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectAgentJob = (bool?) content.GetValueForProperty("CollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectTdeCertificateInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectTdeCertificateInfo = (bool?) content.GetValueForProperty("CollectTdeCertificateInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).CollectTdeCertificateInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).ValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("ValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).ValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to SQL Server and also validates source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskInputTypeConverter))] + public partial interface IConnectToSourceSqlServerTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..b8137def0ba1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.cs new file mode 100644 index 000000000000..e0ae892151cd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.cs @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? _checkPermissionsGroup; + + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? CheckPermissionsGroup { get => this._checkPermissionsGroup; set => this._checkPermissionsGroup = value; } + + /// Backing field for property. + private bool? _collectAgentJob; + + /// Flag for whether to collect agent jobs from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? CollectAgentJob { get => this._collectAgentJob; set => this._collectAgentJob = value; } + + /// Backing field for property. + private bool? _collectDatabase; + + /// Flag for whether to collect databases from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? CollectDatabase { get => this._collectDatabase; set => this._collectDatabase = value; } + + /// Backing field for property. + private bool? _collectLogin; + + /// Flag for whether to collect logins from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? CollectLogin { get => this._collectLogin; set => this._collectLogin = value; } + + /// Backing field for property. + private bool? _collectTdeCertificateInfo; + + /// Flag for whether to collect TDE Certificate names from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? CollectTdeCertificateInfo { get => this._collectTdeCertificateInfo; set => this._collectTdeCertificateInfo = value; } + + /// Backing field for property. + private string _encryptedKeyForSecureField; + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EncryptedKeyForSecureField { get => this._encryptedKeyForSecureField; set => this._encryptedKeyForSecureField = value; } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for Source SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private bool? _validateSsisCatalogOnly; + + /// Flag for whether to validate SSIS catalog is reachable on the source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? ValidateSsisCatalogOnly { get => this._validateSsisCatalogOnly; set => this._validateSsisCatalogOnly = value; } + + /// Creates an new instance. + public ConnectToSourceSqlServerTaskInput() + { + + } + } + /// Input for the task that validates connection to SQL Server and also validates source server requirements + public partial interface IConnectToSourceSqlServerTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Permission group for validations", + SerializedName = @"checkPermissionsGroup", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? CheckPermissionsGroup { get; set; } + /// Flag for whether to collect agent jobs from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect agent jobs from source server.", + SerializedName = @"collectAgentJobs", + PossibleTypes = new [] { typeof(bool) })] + bool? CollectAgentJob { get; set; } + /// Flag for whether to collect databases from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect databases from source server.", + SerializedName = @"collectDatabases", + PossibleTypes = new [] { typeof(bool) })] + bool? CollectDatabase { get; set; } + /// Flag for whether to collect logins from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect logins from source server.", + SerializedName = @"collectLogins", + PossibleTypes = new [] { typeof(bool) })] + bool? CollectLogin { get; set; } + /// Flag for whether to collect TDE Certificate names from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect TDE Certificate names from source server.", + SerializedName = @"collectTdeCertificateInfo", + PossibleTypes = new [] { typeof(bool) })] + bool? CollectTdeCertificateInfo { get; set; } + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string EncryptedKeyForSecureField { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Flag for whether to validate SSIS catalog is reachable on the source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to validate SSIS catalog is reachable on the source server.", + SerializedName = @"validateSsisCatalogOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidateSsisCatalogOnly { get; set; } + + } + /// Input for the task that validates connection to SQL Server and also validates source server requirements + internal partial interface IConnectToSourceSqlServerTaskInputInternal + + { + /// Permission group for validations + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? CheckPermissionsGroup { get; set; } + /// Flag for whether to collect agent jobs from source server. + bool? CollectAgentJob { get; set; } + /// Flag for whether to collect databases from source server. + bool? CollectDatabase { get; set; } + /// Flag for whether to collect logins from source server. + bool? CollectLogin { get; set; } + /// Flag for whether to collect TDE Certificate names from source server. + bool? CollectTdeCertificateInfo { get; set; } + /// encrypted key for secure fields + string EncryptedKeyForSecureField { get; set; } + /// Connection information for Source SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Flag for whether to validate SSIS catalog is reachable on the source server. + bool? ValidateSsisCatalogOnly { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.json.cs new file mode 100644 index 000000000000..26ea982865df --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskInput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_checkPermissionsGroup = If( json?.PropertyT("checkPermissionsGroup"), out var __jsonCheckPermissionsGroup) ? (string)__jsonCheckPermissionsGroup : (string)CheckPermissionsGroup;} + {_collectDatabase = If( json?.PropertyT("collectDatabases"), out var __jsonCollectDatabases) ? (bool?)__jsonCollectDatabases : CollectDatabase;} + {_collectLogin = If( json?.PropertyT("collectLogins"), out var __jsonCollectLogins) ? (bool?)__jsonCollectLogins : CollectLogin;} + {_collectAgentJob = If( json?.PropertyT("collectAgentJobs"), out var __jsonCollectAgentJobs) ? (bool?)__jsonCollectAgentJobs : CollectAgentJob;} + {_collectTdeCertificateInfo = If( json?.PropertyT("collectTdeCertificateInfo"), out var __jsonCollectTdeCertificateInfo) ? (bool?)__jsonCollectTdeCertificateInfo : CollectTdeCertificateInfo;} + {_validateSsisCatalogOnly = If( json?.PropertyT("validateSsisCatalogOnly"), out var __jsonValidateSsisCatalogOnly) ? (bool?)__jsonValidateSsisCatalogOnly : ValidateSsisCatalogOnly;} + {_encryptedKeyForSecureField = If( json?.PropertyT("encryptedKeyForSecureFields"), out var __jsonEncryptedKeyForSecureFields) ? (string)__jsonEncryptedKeyForSecureFields : (string)EncryptedKeyForSecureField;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceSqlServerTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != (((object)this._checkPermissionsGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._checkPermissionsGroup.ToString()) : null, "checkPermissionsGroup" ,container.Add ); + AddIf( null != this._collectDatabase ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._collectDatabase) : null, "collectDatabases" ,container.Add ); + AddIf( null != this._collectLogin ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._collectLogin) : null, "collectLogins" ,container.Add ); + AddIf( null != this._collectAgentJob ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._collectAgentJob) : null, "collectAgentJobs" ,container.Add ); + AddIf( null != this._collectTdeCertificateInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._collectTdeCertificateInfo) : null, "collectTdeCertificateInfo" ,container.Add ); + AddIf( null != this._validateSsisCatalogOnly ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._validateSsisCatalogOnly) : null, "validateSsisCatalogOnly" ,container.Add ); + AddIf( null != (((object)this._encryptedKeyForSecureField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._encryptedKeyForSecureField.ToString()) : null, "encryptedKeyForSecureFields" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..4d4d4af044eb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to SQL Server and also validates source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputTypeConverter))] + public partial class ConnectToSourceSqlServerTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to SQL Server and also validates source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputTypeConverter))] + public partial interface IConnectToSourceSqlServerTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..595839a8219b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.cs new file mode 100644 index 000000000000..9b2569f25506 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Type of result - database level or task level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Creates an new instance. + public ConnectToSourceSqlServerTaskOutput() + { + + } + } + /// Output for the task that validates connection to SQL Server and also validates source server requirements + public partial interface IConnectToSourceSqlServerTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Type of result - database level or task level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of result - database level or task level", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that validates connection to SQL Server and also validates source server requirements + internal partial interface IConnectToSourceSqlServerTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Type of result - database level or task level + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.json.cs new file mode 100644 index 000000000000..53b5d4fe0354 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutput.json.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "TaskLevelOutput": + { + return new ConnectToSourceSqlServerTaskOutputTaskLevel(json); + } + case "DatabaseLevelOutput": + { + return new ConnectToSourceSqlServerTaskOutputDatabaseLevel(json); + } + case "LoginLevelOutput": + { + return new ConnectToSourceSqlServerTaskOutputLoginLevel(json); + } + case "AgentJobLevelOutput": + { + return new ConnectToSourceSqlServerTaskOutputAgentJobLevel(json); + } + } + return new ConnectToSourceSqlServerTaskOutput(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.PowerShell.cs new file mode 100644 index 000000000000..a488ededc3ea --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.PowerShell.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputAgentJobLevelTypeConverter))] + public partial class ConnectToSourceSqlServerTaskOutputAgentJobLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerTaskOutputAgentJobLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationEligibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibility = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo) content.GetValueForProperty("MigrationEligibility",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibility, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("JobCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobCategory = (string) content.GetValueForProperty("JobCategory",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobCategory, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("JobOwner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobOwner = (string) content.GetValueForProperty("JobOwner",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobOwner, global::System.Convert.ToString); + } + if (content.Contains("LastExecutedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).LastExecutedOn = (global::System.DateTime?) content.GetValueForProperty("LastExecutedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).LastExecutedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationEligibilityIsEligibleForMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityIsEligibleForMigration = (bool?) content.GetValueForProperty("MigrationEligibilityIsEligibleForMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityIsEligibleForMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationEligibilityValidationMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityValidationMessage = (string[]) content.GetValueForProperty("MigrationEligibilityValidationMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityValidationMessage, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerTaskOutputAgentJobLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationEligibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibility = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo) content.GetValueForProperty("MigrationEligibility",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibility, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("JobCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobCategory = (string) content.GetValueForProperty("JobCategory",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobCategory, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("JobOwner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobOwner = (string) content.GetValueForProperty("JobOwner",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).JobOwner, global::System.Convert.ToString); + } + if (content.Contains("LastExecutedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).LastExecutedOn = (global::System.DateTime?) content.GetValueForProperty("LastExecutedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).LastExecutedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationEligibilityIsEligibleForMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityIsEligibleForMigration = (bool?) content.GetValueForProperty("MigrationEligibilityIsEligibleForMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityIsEligibleForMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationEligibilityValidationMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityValidationMessage = (string[]) content.GetValueForProperty("MigrationEligibilityValidationMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal)this).MigrationEligibilityValidationMessage, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerTaskOutputAgentJobLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerTaskOutputAgentJobLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputAgentJobLevelTypeConverter))] + public partial interface IConnectToSourceSqlServerTaskOutputAgentJobLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.TypeConverter.cs new file mode 100644 index 000000000000..4378ccb3b7a2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerTaskOutputAgentJobLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerTaskOutputAgentJobLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputAgentJobLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputAgentJobLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.cs new file mode 100644 index 000000000000..4fb6eaae3f00 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputAgentJobLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(); + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; } + + /// Backing field for property. + private bool? _isEnabled; + + /// The state of the original Agent Job. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsEnabled { get => this._isEnabled; } + + /// Backing field for property. + private string _jobCategory; + + /// The type of Agent Job. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string JobCategory { get => this._jobCategory; } + + /// Backing field for property. + private string _jobOwner; + + /// The owner of the Agent Job + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string JobOwner { get => this._jobOwner; } + + /// Backing field for property. + private global::System.DateTime? _lastExecutedOn; + + /// UTC Date and time when the Agent Job was last executed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastExecutedOn { get => this._lastExecutedOn; } + + /// Internal Acessors for IsEnabled + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.IsEnabled { get => this._isEnabled; set { {_isEnabled = value;} } } + + /// Internal Acessors for JobCategory + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.JobCategory { get => this._jobCategory; set { {_jobCategory = value;} } } + + /// Internal Acessors for JobOwner + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.JobOwner { get => this._jobOwner; set { {_jobOwner = value;} } } + + /// Internal Acessors for LastExecutedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.LastExecutedOn { get => this._lastExecutedOn; set { {_lastExecutedOn = value;} } } + + /// Internal Acessors for MigrationEligibility + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.MigrationEligibility { get => (this._migrationEligibility = this._migrationEligibility ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo()); set { {_migrationEligibility = value;} } } + + /// Internal Acessors for MigrationEligibilityIsEligibleForMigration + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.MigrationEligibilityIsEligibleForMigration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).IsEligibleForMigration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).IsEligibleForMigration = value; } + + /// Internal Acessors for MigrationEligibilityValidationMessage + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.MigrationEligibilityValidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).ValidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).ValidationMessage = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo _migrationEligibility; + + /// Information about eligibility of agent job for migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo MigrationEligibility { get => (this._migrationEligibility = this._migrationEligibility ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo()); } + + /// Whether object is eligible for migration or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? MigrationEligibilityIsEligibleForMigration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).IsEligibleForMigration; } + + /// Information about eligibility failure for the server object. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] MigrationEligibilityValidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).ValidationMessage; } + + /// Backing field for property. + private string _name; + + /// Agent Job name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Type of result - database level or task level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ConnectToSourceSqlServerTaskOutputAgentJobLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + } + } + /// Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements + public partial interface IConnectToSourceSqlServerTaskOutputAgentJobLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput + { + /// The state of the original Agent Job. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The state of the original Agent Job.", + SerializedName = @"isEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsEnabled { get; } + /// The type of Agent Job. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of Agent Job.", + SerializedName = @"jobCategory", + PossibleTypes = new [] { typeof(string) })] + string JobCategory { get; } + /// The owner of the Agent Job + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The owner of the Agent Job", + SerializedName = @"jobOwner", + PossibleTypes = new [] { typeof(string) })] + string JobOwner { get; } + /// UTC Date and time when the Agent Job was last executed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC Date and time when the Agent Job was last executed.", + SerializedName = @"lastExecutedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastExecutedOn { get; } + /// Whether object is eligible for migration or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether object is eligible for migration or not.", + SerializedName = @"isEligibleForMigration", + PossibleTypes = new [] { typeof(bool) })] + bool? MigrationEligibilityIsEligibleForMigration { get; } + /// Information about eligibility failure for the server object. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Information about eligibility failure for the server object.", + SerializedName = @"validationMessages", + PossibleTypes = new [] { typeof(string) })] + string[] MigrationEligibilityValidationMessage { get; } + /// Agent Job name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Agent Job name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements + internal partial interface IConnectToSourceSqlServerTaskOutputAgentJobLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal + { + /// The state of the original Agent Job. + bool? IsEnabled { get; set; } + /// The type of Agent Job. + string JobCategory { get; set; } + /// The owner of the Agent Job + string JobOwner { get; set; } + /// UTC Date and time when the Agent Job was last executed. + global::System.DateTime? LastExecutedOn { get; set; } + /// Information about eligibility of agent job for migration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo MigrationEligibility { get; set; } + /// Whether object is eligible for migration or not. + bool? MigrationEligibilityIsEligibleForMigration { get; set; } + /// Information about eligibility failure for the server object. + string[] MigrationEligibilityValidationMessage { get; set; } + /// Agent Job name + string Name { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.json.cs new file mode 100644 index 000000000000..2e8594d34d6e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.json.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputAgentJobLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerTaskOutputAgentJobLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(json); + {_migrationEligibility = If( json?.PropertyT("migrationEligibility"), out var __jsonMigrationEligibility) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo.FromJson(__jsonMigrationEligibility) : MigrationEligibility;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_jobCategory = If( json?.PropertyT("jobCategory"), out var __jsonJobCategory) ? (string)__jsonJobCategory : (string)JobCategory;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} + {_jobOwner = If( json?.PropertyT("jobOwner"), out var __jsonJobOwner) ? (string)__jsonJobOwner : (string)JobOwner;} + {_lastExecutedOn = If( json?.PropertyT("lastExecutedOn"), out var __jsonLastExecutedOn) ? global::System.DateTime.TryParse((string)__jsonLastExecutedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastExecutedOnValue) ? __jsonLastExecutedOnValue : LastExecutedOn : LastExecutedOn;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceSqlServerTaskOutputAgentJobLevel(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectToSourceSqlServerTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._migrationEligibility ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationEligibility.ToJson(null,serializationMode) : null, "migrationEligibility" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._jobCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._jobCategory.ToString()) : null, "jobCategory" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isEnabled) : null, "isEnabled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._jobOwner)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._jobOwner.ToString()) : null, "jobOwner" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastExecutedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastExecutedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastExecutedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..c539ac52124a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Database level output for the task that validates connection to SQL Server and also validates source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputDatabaseLevelTypeConverter))] + public partial class ConnectToSourceSqlServerTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DatabaseFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo[]) content.GetValueForProperty("DatabaseFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("CompatibilityLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).CompatibilityLevel = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel?) content.GetValueForProperty("CompatibilityLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).CompatibilityLevel, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel.CreateFrom); + } + if (content.Contains("DatabaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState?) content.GetValueForProperty("DatabaseState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DatabaseFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo[]) content.GetValueForProperty("DatabaseFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("CompatibilityLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).CompatibilityLevel = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel?) content.GetValueForProperty("CompatibilityLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).CompatibilityLevel, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel.CreateFrom); + } + if (content.Contains("DatabaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState?) content.GetValueForProperty("DatabaseState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal)this).DatabaseState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database level output for the task that validates connection to SQL Server and also validates source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputDatabaseLevelTypeConverter))] + public partial interface IConnectToSourceSqlServerTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..c99a0f8d6467 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..00745a4f8dfc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? _compatibilityLevel; + + /// SQL Server compatibility level of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? CompatibilityLevel { get => this._compatibilityLevel; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo[] _databaseFile; + + /// The list of database files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo[] DatabaseFile { get => this._databaseFile; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? _databaseState; + + /// State of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? DatabaseState { get => this._databaseState; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; } + + /// Internal Acessors for CompatibilityLevel + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal.CompatibilityLevel { get => this._compatibilityLevel; set { {_compatibilityLevel = value;} } } + + /// Internal Acessors for DatabaseFile + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal.DatabaseFile { get => this._databaseFile; set { {_databaseFile = value;} } } + + /// Internal Acessors for DatabaseState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal.DatabaseState { get => this._databaseState; set { {_databaseState = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for SizeMb + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal.SizeMb { get => this._sizeMb; set { {_sizeMb = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id = value; } + + /// Backing field for property. + private string _name; + + /// Database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Type of result - database level or task level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType = value ; } + + /// Backing field for property. + private double? _sizeMb; + + /// Size of the file in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? SizeMb { get => this._sizeMb; } + + /// + /// Creates an new instance. + /// + public ConnectToSourceSqlServerTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + } + } + /// Database level output for the task that validates connection to SQL Server and also validates source server requirements + public partial interface IConnectToSourceSqlServerTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput + { + /// SQL Server compatibility level of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"SQL Server compatibility level of database", + SerializedName = @"compatibilityLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? CompatibilityLevel { get; } + /// The list of database files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of database files", + SerializedName = @"databaseFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo[] DatabaseFile { get; } + /// State of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"State of the database", + SerializedName = @"databaseState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? DatabaseState { get; } + /// Database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Size of the file in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Size of the file in megabytes", + SerializedName = @"sizeMB", + PossibleTypes = new [] { typeof(double) })] + double? SizeMb { get; } + + } + /// Database level output for the task that validates connection to SQL Server and also validates source server requirements + internal partial interface IConnectToSourceSqlServerTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal + { + /// SQL Server compatibility level of database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? CompatibilityLevel { get; set; } + /// The list of database files + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo[] DatabaseFile { get; set; } + /// State of the database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? DatabaseState { get; set; } + /// Database name + string Name { get; set; } + /// Size of the file in megabytes + double? SizeMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..55b6212086ea --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(json); + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_sizeMb = If( json?.PropertyT("sizeMB"), out var __jsonSizeMb) ? (double?)__jsonSizeMb : SizeMb;} + {_databaseFile = If( json?.PropertyT("databaseFiles"), out var __jsonDatabaseFiles) ? If( __jsonDatabaseFiles as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInfo.FromJson(__u) )) ))() : null : DatabaseFile;} + {_compatibilityLevel = If( json?.PropertyT("compatibilityLevel"), out var __jsonCompatibilityLevel) ? (string)__jsonCompatibilityLevel : (string)CompatibilityLevel;} + {_databaseState = If( json?.PropertyT("databaseState"), out var __jsonDatabaseState) ? (string)__jsonDatabaseState : (string)DatabaseState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceSqlServerTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectToSourceSqlServerTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sizeMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._sizeMb) : null, "sizeMB" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._databaseFile) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._databaseFile ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("databaseFiles",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._compatibilityLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._compatibilityLevel.ToString()) : null, "compatibilityLevel" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseState.ToString()) : null, "databaseState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.PowerShell.cs new file mode 100644 index 000000000000..f862d469d745 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.PowerShell.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Login level output for the task that validates connection to SQL Server and also validates source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputLoginLevelTypeConverter))] + public partial class ConnectToSourceSqlServerTaskOutputLoginLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerTaskOutputLoginLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationEligibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibility = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo) content.GetValueForProperty("MigrationEligibility",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibility, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LoginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).LoginType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType?) content.GetValueForProperty("LoginType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).LoginType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType.CreateFrom); + } + if (content.Contains("DefaultDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).DefaultDatabase = (string) content.GetValueForProperty("DefaultDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).DefaultDatabase, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationEligibilityIsEligibleForMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityIsEligibleForMigration = (bool?) content.GetValueForProperty("MigrationEligibilityIsEligibleForMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityIsEligibleForMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationEligibilityValidationMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityValidationMessage = (string[]) content.GetValueForProperty("MigrationEligibilityValidationMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityValidationMessage, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerTaskOutputLoginLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationEligibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibility = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo) content.GetValueForProperty("MigrationEligibility",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibility, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LoginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).LoginType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType?) content.GetValueForProperty("LoginType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).LoginType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType.CreateFrom); + } + if (content.Contains("DefaultDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).DefaultDatabase = (string) content.GetValueForProperty("DefaultDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).DefaultDatabase, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationEligibilityIsEligibleForMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityIsEligibleForMigration = (bool?) content.GetValueForProperty("MigrationEligibilityIsEligibleForMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityIsEligibleForMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationEligibilityValidationMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityValidationMessage = (string[]) content.GetValueForProperty("MigrationEligibilityValidationMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal)this).MigrationEligibilityValidationMessage, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerTaskOutputLoginLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerTaskOutputLoginLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Login level output for the task that validates connection to SQL Server and also validates source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputLoginLevelTypeConverter))] + public partial interface IConnectToSourceSqlServerTaskOutputLoginLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.TypeConverter.cs new file mode 100644 index 000000000000..bfed674ff687 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerTaskOutputLoginLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerTaskOutputLoginLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputLoginLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputLoginLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.cs new file mode 100644 index 000000000000..b57f23c11bdd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Login level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputLoginLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(); + + /// Backing field for property. + private string _defaultDatabase; + + /// The default database for the login. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DefaultDatabase { get => this._defaultDatabase; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; } + + /// Backing field for property. + private bool? _isEnabled; + + /// The state of the login. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsEnabled { get => this._isEnabled; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType? _loginType; + + /// The type of login. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType? LoginType { get => this._loginType; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id = value; } + + /// Internal Acessors for DefaultDatabase + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal.DefaultDatabase { get => this._defaultDatabase; set { {_defaultDatabase = value;} } } + + /// Internal Acessors for IsEnabled + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal.IsEnabled { get => this._isEnabled; set { {_isEnabled = value;} } } + + /// Internal Acessors for LoginType + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal.LoginType { get => this._loginType; set { {_loginType = value;} } } + + /// Internal Acessors for MigrationEligibility + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal.MigrationEligibility { get => (this._migrationEligibility = this._migrationEligibility ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo()); set { {_migrationEligibility = value;} } } + + /// Internal Acessors for MigrationEligibilityIsEligibleForMigration + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal.MigrationEligibilityIsEligibleForMigration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).IsEligibleForMigration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).IsEligibleForMigration = value; } + + /// Internal Acessors for MigrationEligibilityValidationMessage + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal.MigrationEligibilityValidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).ValidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).ValidationMessage = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevelInternal.Name { get => this._name; set { {_name = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo _migrationEligibility; + + /// Information about eligibility of login for migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo MigrationEligibility { get => (this._migrationEligibility = this._migrationEligibility ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo()); } + + /// Whether object is eligible for migration or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? MigrationEligibilityIsEligibleForMigration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).IsEligibleForMigration; } + + /// Information about eligibility failure for the server object. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] MigrationEligibilityValidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)MigrationEligibility).ValidationMessage; } + + /// Backing field for property. + private string _name; + + /// Login name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Type of result - database level or task level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType = value ; } + + /// + /// Creates an new instance. + /// + public ConnectToSourceSqlServerTaskOutputLoginLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + } + } + /// Login level output for the task that validates connection to SQL Server and also validates source server requirements + public partial interface IConnectToSourceSqlServerTaskOutputLoginLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput + { + /// The default database for the login. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The default database for the login.", + SerializedName = @"defaultDatabase", + PossibleTypes = new [] { typeof(string) })] + string DefaultDatabase { get; } + /// The state of the login. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The state of the login.", + SerializedName = @"isEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsEnabled { get; } + /// The type of login. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of login.", + SerializedName = @"loginType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType? LoginType { get; } + /// Whether object is eligible for migration or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether object is eligible for migration or not.", + SerializedName = @"isEligibleForMigration", + PossibleTypes = new [] { typeof(bool) })] + bool? MigrationEligibilityIsEligibleForMigration { get; } + /// Information about eligibility failure for the server object. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Information about eligibility failure for the server object.", + SerializedName = @"validationMessages", + PossibleTypes = new [] { typeof(string) })] + string[] MigrationEligibilityValidationMessage { get; } + /// Login name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Login name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + } + /// Login level output for the task that validates connection to SQL Server and also validates source server requirements + internal partial interface IConnectToSourceSqlServerTaskOutputLoginLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal + { + /// The default database for the login. + string DefaultDatabase { get; set; } + /// The state of the login. + bool? IsEnabled { get; set; } + /// The type of login. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType? LoginType { get; set; } + /// Information about eligibility of login for migration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo MigrationEligibility { get; set; } + /// Whether object is eligible for migration or not. + bool? MigrationEligibilityIsEligibleForMigration { get; set; } + /// Information about eligibility failure for the server object. + string[] MigrationEligibilityValidationMessage { get; set; } + /// Login name. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.json.cs new file mode 100644 index 000000000000..fbd54fd3eedf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputLoginLevel.json.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Login level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputLoginLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerTaskOutputLoginLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(json); + {_migrationEligibility = If( json?.PropertyT("migrationEligibility"), out var __jsonMigrationEligibility) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationEligibilityInfo.FromJson(__jsonMigrationEligibility) : MigrationEligibility;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_loginType = If( json?.PropertyT("loginType"), out var __jsonLoginType) ? (string)__jsonLoginType : (string)LoginType;} + {_defaultDatabase = If( json?.PropertyT("defaultDatabase"), out var __jsonDefaultDatabase) ? (string)__jsonDefaultDatabase : (string)DefaultDatabase;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceSqlServerTaskOutputLoginLevel(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectToSourceSqlServerTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._migrationEligibility ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationEligibility.ToJson(null,serializationMode) : null, "migrationEligibility" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._loginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._loginType.ToString()) : null, "loginType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._defaultDatabase)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._defaultDatabase.ToString()) : null, "defaultDatabase" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isEnabled) : null, "isEnabled" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.PowerShell.cs new file mode 100644 index 000000000000..c9154c2781ac --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.PowerShell.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Task level output for the task that validates connection to SQL Server and also validates source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputTaskLevelTypeConverter))] + public partial class ConnectToSourceSqlServerTaskOutputTaskLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerTaskOutputTaskLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("AgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).AgentJob = (string) content.GetValueForProperty("AgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).AgentJob, global::System.Convert.ToString); + } + if (content.Contains("DatabaseTdeCertificateMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).DatabaseTdeCertificateMapping = (string) content.GetValueForProperty("DatabaseTdeCertificateMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).DatabaseTdeCertificateMapping, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerTaskOutputTaskLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("AgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).AgentJob = (string) content.GetValueForProperty("AgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).AgentJob, global::System.Convert.ToString); + } + if (content.Contains("DatabaseTdeCertificateMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).DatabaseTdeCertificateMapping = (string) content.GetValueForProperty("DatabaseTdeCertificateMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).DatabaseTdeCertificateMapping, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerTaskOutputTaskLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerTaskOutputTaskLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Task level output for the task that validates connection to SQL Server and also validates source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskOutputTaskLevelTypeConverter))] + public partial interface IConnectToSourceSqlServerTaskOutputTaskLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.TypeConverter.cs new file mode 100644 index 000000000000..61524e7c5b98 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerTaskOutputTaskLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerTaskOutputTaskLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputTaskLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskOutputTaskLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.cs new file mode 100644 index 000000000000..e55d52a72360 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Task level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputTaskLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(); + + /// Backing field for property. + private string _agentJob; + + /// Source agent jobs as a map from agent job name to id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AgentJob { get => this._agentJob; } + + /// Backing field for property. + private string _database; + + /// Source databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Database { get => this._database; } + + /// Backing field for property. + private string _databaseTdeCertificateMapping; + + /// Mapping from database name to TDE certificate name, if applicable + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseTdeCertificateMapping { get => this._databaseTdeCertificateMapping; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; } + + /// Backing field for property. + private string _login; + + /// Source logins as a map from login name to login id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Login { get => this._login; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).Id = value; } + + /// Internal Acessors for AgentJob + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal.AgentJob { get => this._agentJob; set { {_agentJob = value;} } } + + /// Internal Acessors for Database + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for DatabaseTdeCertificateMapping + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal.DatabaseTdeCertificateMapping { get => this._databaseTdeCertificateMapping; set { {_databaseTdeCertificateMapping = value;} } } + + /// Internal Acessors for Login + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal.Login { get => this._login; set { {_login = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevelInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Type of result - database level or task level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal)__connectToSourceSqlServerTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ConnectToSourceSqlServerTaskOutputTaskLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__connectToSourceSqlServerTaskOutput), __connectToSourceSqlServerTaskOutput); + } + } + /// Task level output for the task that validates connection to SQL Server and also validates source server requirements + public partial interface IConnectToSourceSqlServerTaskOutputTaskLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput + { + /// Source agent jobs as a map from agent job name to id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source agent jobs as a map from agent job name to id.", + SerializedName = @"agentJobs", + PossibleTypes = new [] { typeof(string) })] + string AgentJob { get; } + /// Source databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source databases as a map from database name to database id", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string Database { get; } + /// Mapping from database name to TDE certificate name, if applicable + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mapping from database name to TDE certificate name, if applicable", + SerializedName = @"databaseTdeCertificateMapping", + PossibleTypes = new [] { typeof(string) })] + string DatabaseTdeCertificateMapping { get; } + /// Source logins as a map from login name to login id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source logins as a map from login name to login id.", + SerializedName = @"logins", + PossibleTypes = new [] { typeof(string) })] + string Login { get; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Task level output for the task that validates connection to SQL Server and also validates source server requirements + internal partial interface IConnectToSourceSqlServerTaskOutputTaskLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputInternal + { + /// Source agent jobs as a map from agent job name to id. + string AgentJob { get; set; } + /// Source databases as a map from database name to database id + string Database { get; set; } + /// Mapping from database name to TDE certificate name, if applicable + string DatabaseTdeCertificateMapping { get; set; } + /// Source logins as a map from login name to login id. + string Login { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.json.cs new file mode 100644 index 000000000000..882cacd2176b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskOutputTaskLevel.json.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Task level output for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskOutputTaskLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerTaskOutputTaskLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectToSourceSqlServerTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput(json); + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? (string)__jsonDatabases : (string)Database;} + {_login = If( json?.PropertyT("logins"), out var __jsonLogins) ? (string)__jsonLogins : (string)Login;} + {_agentJob = If( json?.PropertyT("agentJobs"), out var __jsonAgentJobs) ? (string)__jsonAgentJobs : (string)AgentJob;} + {_databaseTdeCertificateMapping = If( json?.PropertyT("databaseTdeCertificateMapping"), out var __jsonDatabaseTdeCertificateMapping) ? (string)__jsonDatabaseTdeCertificateMapping : (string)DatabaseTdeCertificateMapping;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceSqlServerTaskOutputTaskLevel(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectToSourceSqlServerTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._database)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._database.ToString()) : null, "databases" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._login)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._login.ToString()) : null, "logins" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._agentJob)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._agentJob.ToString()) : null, "agentJobs" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseTdeCertificateMapping)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseTdeCertificateMapping.ToString()) : null, "databaseTdeCertificateMapping" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..8c140cec62d6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.PowerShell.cs @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to SQL Server and also validates source server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskPropertiesTypeConverter))] + public partial class ConnectToSourceSqlServerTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToSourceSqlServerTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputCheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("InputCheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("InputCollectDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectDatabase = (bool?) content.GetValueForProperty("InputCollectDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectDatabase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectLogin = (bool?) content.GetValueForProperty("InputCollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectAgentJob = (bool?) content.GetValueForProperty("InputCollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectTdeCertificateInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectTdeCertificateInfo = (bool?) content.GetValueForProperty("InputCollectTdeCertificateInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectTdeCertificateInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("InputValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputEncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputEncryptedKeyForSecureField = (string) content.GetValueForProperty("InputEncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputEncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToSourceSqlServerTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputCheckPermissionsGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCheckPermissionsGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup?) content.GetValueForProperty("InputCheckPermissionsGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCheckPermissionsGroup, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup.CreateFrom); + } + if (content.Contains("InputCollectDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectDatabase = (bool?) content.GetValueForProperty("InputCollectDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectDatabase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectLogin = (bool?) content.GetValueForProperty("InputCollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectAgentJob = (bool?) content.GetValueForProperty("InputCollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectTdeCertificateInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectTdeCertificateInfo = (bool?) content.GetValueForProperty("InputCollectTdeCertificateInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputCollectTdeCertificateInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("InputValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputEncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputEncryptedKeyForSecureField = (string) content.GetValueForProperty("InputEncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).InputEncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToSourceSqlServerTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToSourceSqlServerTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to SQL Server and also validates source server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToSourceSqlServerTaskPropertiesTypeConverter))] + public partial interface IConnectToSourceSqlServerTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..04de31d0cef2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToSourceSqlServerTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToSourceSqlServerTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToSourceSqlServerTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.cs new file mode 100644 index 000000000000..d6348b3448bf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput()); set => this._input = value; } + + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CheckPermissionsGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CheckPermissionsGroup = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup)""); } + + /// Flag for whether to collect agent jobs from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectAgentJob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectAgentJob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectAgentJob = value ?? default(bool); } + + /// Flag for whether to collect databases from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectDatabase = value ?? default(bool); } + + /// Flag for whether to collect logins from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectLogin { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectLogin; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectLogin = value ?? default(bool); } + + /// Flag for whether to collect TDE Certificate names from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectTdeCertificateInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectTdeCertificateInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).CollectTdeCertificateInfo = value ?? default(bool); } + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputEncryptedKeyForSecureField { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).EncryptedKeyForSecureField; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).EncryptedKeyForSecureField = value ?? null; } + + /// Flag for whether to validate SSIS catalog is reachable on the source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputValidateSsisCatalogOnly { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).ValidateSsisCatalogOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).ValidateSsisCatalogOnly = value ?? default(bool); } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputSourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal.InputSourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Output { get => this._output; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInputInternal)Input).SourceConnectionInfoUserName = value ?? null; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Backing field for property. + private string _taskId; + + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToSourceSqlServerTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to SQL Server and also validates source server requirements + public partial interface IConnectToSourceSqlServerTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Permission group for validations + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Permission group for validations", + SerializedName = @"checkPermissionsGroup", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get; set; } + /// Flag for whether to collect agent jobs from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect agent jobs from source server.", + SerializedName = @"collectAgentJobs", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectAgentJob { get; set; } + /// Flag for whether to collect databases from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect databases from source server.", + SerializedName = @"collectDatabases", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectDatabase { get; set; } + /// Flag for whether to collect logins from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect logins from source server.", + SerializedName = @"collectLogins", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectLogin { get; set; } + /// Flag for whether to collect TDE Certificate names from source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect TDE Certificate names from source server.", + SerializedName = @"collectTdeCertificateInfo", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectTdeCertificateInfo { get; set; } + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string InputEncryptedKeyForSecureField { get; set; } + /// Flag for whether to validate SSIS catalog is reachable on the source server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to validate SSIS catalog is reachable on the source server.", + SerializedName = @"validateSsisCatalogOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? InputValidateSsisCatalogOnly { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputTaskLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputLoginLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutputAgentJobLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task id ", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Properties for the task that validates connection to SQL Server and also validates source server requirements + internal partial interface IConnectToSourceSqlServerTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskInput Input { get; set; } + /// Permission group for validations + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup? InputCheckPermissionsGroup { get; set; } + /// Flag for whether to collect agent jobs from source server. + bool? InputCollectAgentJob { get; set; } + /// Flag for whether to collect databases from source server. + bool? InputCollectDatabase { get; set; } + /// Flag for whether to collect logins from source server. + bool? InputCollectLogin { get; set; } + /// Flag for whether to collect TDE Certificate names from source server. + bool? InputCollectTdeCertificateInfo { get; set; } + /// encrypted key for secure fields + string InputEncryptedKeyForSecureField { get; set; } + /// Connection information for Source SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo InputSourceConnectionInfo { get; set; } + /// Flag for whether to validate SSIS catalog is reachable on the source server. + bool? InputValidateSsisCatalogOnly { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput[] Output { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Task id + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.json.cs new file mode 100644 index 000000000000..3b315a24d46e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToSourceSqlServerTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL Server and also validates source server requirements + /// + public partial class ConnectToSourceSqlServerTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToSourceSqlServerTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToSourceSqlServerTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToSourceSqlServerTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToSourceSqlServerTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.PowerShell.cs new file mode 100644 index 000000000000..0454c14d4e71 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.PowerShell.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to Azure Database for MySQL and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForMySqlTaskInputTypeConverter))] + public partial class ConnectToTargetAzureDbForMySqlTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetAzureDbForMySqlTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).IsOfflineMigration = (bool?) content.GetValueForProperty("IsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).IsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetAzureDbForMySqlTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).IsOfflineMigration = (bool?) content.GetValueForProperty("IsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).IsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetAzureDbForMySqlTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetAzureDbForMySqlTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to Azure Database for MySQL and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForMySqlTaskInputTypeConverter))] + public partial interface IConnectToTargetAzureDbForMySqlTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..bd53de6a4b26 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetAzureDbForMySqlTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetAzureDbForMySqlTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForMySqlTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForMySqlTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.cs new file mode 100644 index 000000000000..5905afb883a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.cs @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure Database for MySQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForMySqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal + { + + /// Backing field for property. + private bool? _isOfflineMigration; + + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsOfflineMigration { get => this._isOfflineMigration; set => this._isOfflineMigration = value; } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source MySQL server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target Azure Database for MySQL server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public ConnectToTargetAzureDbForMySqlTaskInput() + { + + } + } + /// Input for the task that validates connection to Azure Database for MySQL and target server requirements + public partial interface IConnectToTargetAzureDbForMySqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether or not the migration is offline", + SerializedName = @"isOfflineMigration", + PossibleTypes = new [] { typeof(bool) })] + bool? IsOfflineMigration { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int SourceConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int TargetConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates connection to Azure Database for MySQL and target server requirements + internal partial interface IConnectToTargetAzureDbForMySqlTaskInputInternal + + { + /// Flag for whether or not the migration is offline + bool? IsOfflineMigration { get; set; } + /// Connection information for source MySQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int SourceConnectionInfoPort { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Connection information for target Azure Database for MySQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int TargetConnectionInfoPort { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.json.cs new file mode 100644 index 000000000000..293c9ab57362 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskInput.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure Database for MySQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForMySqlTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetAzureDbForMySqlTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_isOfflineMigration = If( json?.PropertyT("isOfflineMigration"), out var __jsonIsOfflineMigration) ? (bool?)__jsonIsOfflineMigration : IsOfflineMigration;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetAzureDbForMySqlTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._isOfflineMigration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isOfflineMigration) : null, "isOfflineMigration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..7adcbfa1fc3d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.PowerShell.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to Azure Database for MySQL and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForMySqlTaskOutputTypeConverter))] + public partial class ConnectToTargetAzureDbForMySqlTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetAzureDbForMySqlTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetAzureDbForMySqlTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetAzureDbForMySqlTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetAzureDbForMySqlTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to Azure Database for MySQL and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForMySqlTaskOutputTypeConverter))] + public partial interface IConnectToTargetAzureDbForMySqlTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..36842af834ba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetAzureDbForMySqlTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetAzureDbForMySqlTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForMySqlTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForMySqlTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.cs new file mode 100644 index 000000000000..aca38cadf70f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure Database for MySQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForMySqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal + { + + /// Backing field for property. + private string[] _database; + + /// List of databases on target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Database { get => this._database; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Database + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for ServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal.ServerVersion { get => this._serverVersion; set { {_serverVersion = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _serverVersion; + + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetAzureDbForMySqlTaskOutput() + { + + } + } + /// Output for the task that validates connection to Azure Database for MySQL and target server requirements + public partial interface IConnectToTargetAzureDbForMySqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of databases on target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of databases on target server", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string[] Database { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the target server", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that validates connection to Azure Database for MySQL and target server requirements + internal partial interface IConnectToTargetAzureDbForMySqlTaskOutputInternal + + { + /// List of databases on target server + string[] Database { get; set; } + /// Result identifier + string Id { get; set; } + /// Version of the target server + string ServerVersion { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.json.cs new file mode 100644 index 000000000000..eb2785460ba3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskOutput.json.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure Database for MySQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForMySqlTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetAzureDbForMySqlTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? If( __jsonDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Database;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetAzureDbForMySqlTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._database) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._database ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("databases",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..89f5839d445e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.PowerShell.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to Azure Database for MySQL and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForMySqlTaskPropertiesTypeConverter))] + public partial class ConnectToTargetAzureDbForMySqlTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetAzureDbForMySqlTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputIsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputIsOfflineMigration = (bool?) content.GetValueForProperty("InputIsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputIsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetAzureDbForMySqlTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputIsOfflineMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputIsOfflineMigration = (bool?) content.GetValueForProperty("InputIsOfflineMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).InputIsOfflineMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetAzureDbForMySqlTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetAzureDbForMySqlTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to Azure Database for MySQL and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForMySqlTaskPropertiesTypeConverter))] + public partial interface IConnectToTargetAzureDbForMySqlTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..cc2833edef93 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetAzureDbForMySqlTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetAzureDbForMySqlTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForMySqlTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForMySqlTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.cs new file mode 100644 index 000000000000..ec5c1bea4855 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure Database for MySQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForMySqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskInput()); set => this._input = value; } + + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputIsOfflineMigration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).IsOfflineMigration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).IsOfflineMigration = value ?? default(bool); } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputSourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal.InputSourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfo = value; } + + /// Internal Acessors for InputTargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal.InputTargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput[] Output { get => this._output; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoPort = value ?? default(int); } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoServerName = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).SourceConnectionInfoUserName = value ?? null; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoPort = value ?? default(int); } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoServerName = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInputInternal)Input).TargetConnectionInfoUserName = value ?? null; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetAzureDbForMySqlTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to Azure Database for MySQL and target server requirements + public partial interface IConnectToTargetAzureDbForMySqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Flag for whether or not the migration is offline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether or not the migration is offline", + SerializedName = @"isOfflineMigration", + PossibleTypes = new [] { typeof(bool) })] + bool? InputIsOfflineMigration { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates connection to Azure Database for MySQL and target server requirements + internal partial interface IConnectToTargetAzureDbForMySqlTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskInput Input { get; set; } + /// Flag for whether or not the migration is offline + bool? InputIsOfflineMigration { get; set; } + /// Connection information for source MySQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo InputSourceConnectionInfo { get; set; } + /// Connection information for target Azure Database for MySQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo InputTargetConnectionInfo { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput[] Output { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.json.cs new file mode 100644 index 000000000000..0ec22116ce81 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForMySqlTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure Database for MySQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForMySqlTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetAzureDbForMySqlTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForMySqlTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForMySqlTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetAzureDbForMySqlTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..0c69b0670fff --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForPostgreSqlSyncTaskInputTypeConverter))] + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForPostgreSqlSyncTaskInputTypeConverter))] + public partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..1022658e59d8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.cs new file mode 100644 index 000000000000..4ec0b2cc2c66 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source PostgreSQL server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target Azure Database for PostgreSQL server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetAzureDbForPostgreSqlSyncTaskInput() + { + + } + } + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements + public partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int SourceConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int TargetConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements + internal partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskInputInternal + + { + /// Connection information for source PostgreSQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int SourceConnectionInfoPort { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Connection information for target Azure Database for PostgreSQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int TargetConnectionInfoPort { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.json.cs new file mode 100644 index 000000000000..6fab4fac2268 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..b6a7e91a82b1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTypeConverter))] + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTypeConverter))] + public partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..2b705b202c08 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.cs new file mode 100644 index 000000000000..2b9eb0d1b829 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal + { + + /// Backing field for property. + private string[] _database; + + /// List of databases on target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Database { get => this._database; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Database + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput() + { + + } + } + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements + public partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of databases on target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of databases on target server", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string[] Database { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the target server", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements + internal partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskOutputInternal + + { + /// List of databases on target server + string[] Database { get; set; } + /// Result identifier + string Id { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Version of the target server + string TargetServerVersion { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..103ad69904fb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.json.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? If( __jsonDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Database;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._database) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._database ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("databases",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..a8754813ee04 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..1710c1ddc81a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 000000000000..ec3394860ef6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration + public partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput[] Output { get; } + + } + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration + internal partial interface IConnectToTargetAzureDbForPostgreSqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..035d0a09c95c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration + /// + public partial class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetAzureDbForPostgreSqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..4a66e1a647c4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputTypeConverter))] + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputTypeConverter))] + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..aa78c47e4055 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.cs new file mode 100644 index 000000000000..cbdc8443c369 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal + { + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target Azure Database for PostgreSQL server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput() + { + + } + } + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int TargetConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + internal partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal + + { + /// Connection information for target Azure Database for PostgreSQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int TargetConnectionInfoPort { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.json.cs new file mode 100644 index 000000000000..a295b13fd597 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..c2be047452f2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputTypeConverter))] + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("DatabaseSchemaMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).DatabaseSchemaMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem[]) content.GetValueForProperty("DatabaseSchemaMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).DatabaseSchemaMap, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database = (string[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("DatabaseSchemaMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).DatabaseSchemaMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem[]) content.GetValueForProperty("DatabaseSchemaMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal)this).DatabaseSchemaMap, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputTypeConverter))] + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..a03f39905e79 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.cs new file mode 100644 index 000000000000..96ec5a653061 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal + { + + /// Backing field for property. + private string[] _database; + + /// List of databases on target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Database { get => this._database; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem[] _databaseSchemaMap; + + /// Mapping of schemas per database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem[] DatabaseSchemaMap { get => this._databaseSchemaMap; set => this._databaseSchemaMap = value; } + + /// Internal Acessors for Database + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput() + { + + } + } + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of databases on target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of databases on target server", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string[] Database { get; } + /// Mapping of schemas per database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of schemas per database", + SerializedName = @"databaseSchemaMap", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem[] DatabaseSchemaMap { get; set; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the target server", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + internal partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputInternal + + { + /// List of databases on target server + string[] Database { get; set; } + /// Mapping of schemas per database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem[] DatabaseSchemaMap { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Version of the target server + string TargetServerVersion { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..38d3f4b71bf2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.json.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle + /// source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? If( __jsonDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Database;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + {_databaseSchemaMap = If( json?.PropertyT("databaseSchemaMap"), out var __jsonDatabaseSchemaMap) ? If( __jsonDatabaseSchemaMap as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.FromJson(__k) )) ))() : null : DatabaseSchemaMap;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._database) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._database ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("databases",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + if (null != this._databaseSchemaMap) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __n in this._databaseSchemaMap ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("databaseSchemaMap",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.PowerShell.cs new file mode 100644 index 000000000000..71ca30327af7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.PowerShell.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemTypeConverter))] + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("Schema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Schema = (string[]) content.GetValueForProperty("Schema",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Schema, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("Schema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Schema = (string[]) content.GetValueForProperty("Schema",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal)this).Schema, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(content); + } + + /// + /// Creates a new instance of , + /// deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemTypeConverter))] + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.TypeConverter.cs new file mode 100644 index 000000000000..6ce295633616 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null + /// if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null + /// if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.cs new file mode 100644 index 000000000000..d402ea720fd8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal + { + + /// Backing field for property. + private string _database; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Database { get => this._database; set => this._database = value; } + + /// Backing field for property. + private string[] _schema; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Schema { get => this._schema; set => this._schema = value; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem() + { + + } + } + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"database", + PossibleTypes = new [] { typeof(string) })] + string Database { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"schemas", + PossibleTypes = new [] { typeof(string) })] + string[] Schema { get; set; } + + } + internal partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItemInternal + + { + string Database { get; set; } + + string[] Schema { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.json.cs new file mode 100644 index 000000000000..760cab4da576 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_database = If( json?.PropertyT("database"), out var __jsonDatabase) ? (string)__jsonDatabase : (string)Database;} + {_schema = If( json?.PropertyT("schemas"), out var __jsonSchemas) ? If( __jsonSchemas as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Schema;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(json) : null; + } + + /// + /// Serializes this instance of + /// into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as + /// a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._database)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._database.ToString()) : null, "database" ,container.Add ); + if (null != this._schema) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._schema ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("schemas",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..74af1cefa1f5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration for Oracle source. + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration for Oracle source. + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..9561e033aa40 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 000000000000..01ad8fe316f4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.cs @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration for Oracle source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputTargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal.InputTargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoDataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoDatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoPort = value ?? default(int); } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInputInternal)Input).TargetConnectionInfoUserName = value ?? null; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration for Oracle source. + public partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration for Oracle source. + internal partial interface IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput Input { get; set; } + /// Connection information for target Azure Database for PostgreSQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo InputTargetConnectionInfo { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput[] Output { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..acfa17e8156e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements + /// for online migration for Oracle source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..ae6d1b3dac5d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.PowerShell.cs @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to Azure SQL DB and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbSyncTaskInputTypeConverter))] + public partial class ConnectToTargetSqlDbSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlDbSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlDbSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlDbSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlDbSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to Azure SQL DB and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbSyncTaskInputTypeConverter))] + public partial interface IConnectToTargetSqlDbSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..77164c745c6f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlDbSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlDbSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.cs new file mode 100644 index 000000000000..1042f92c3f71 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.cs @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target SQL DB + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public ConnectToTargetSqlDbSyncTaskInput() + { + + } + } + /// Input for the task that validates connection to Azure SQL DB and target server requirements + public partial interface IConnectToTargetSqlDbSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates connection to Azure SQL DB and target server requirements + internal partial interface IConnectToTargetSqlDbSyncTaskInputInternal + + { + /// Connection information for source SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Connection information for target SQL DB + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.json.cs new file mode 100644 index 000000000000..1607f3264fb6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskInput.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlDbSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlDbSyncTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..bc6fbb0c2ee8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to SQL DB and target server requirements for online migration + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbSyncTaskPropertiesTypeConverter))] + public partial class ConnectToTargetSqlDbSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlDbSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlDbSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlDbSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlDbSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to SQL DB and target server requirements for online migration + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbSyncTaskPropertiesTypeConverter))] + public partial interface IConnectToTargetSqlDbSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..fd3817bb8a34 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlDbSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlDbSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.cs new file mode 100644 index 000000000000..ec7d35666868 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL DB and target server requirements for online migration + /// + public partial class ConnectToTargetSqlDbSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToTargetSqlDbSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to SQL DB and target server requirements for online migration + public partial interface IConnectToTargetSqlDbSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Output { get; } + + } + /// Properties for the task that validates connection to SQL DB and target server requirements for online migration + internal partial interface IConnectToTargetSqlDbSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.json.cs new file mode 100644 index 000000000000..8686a4dba0d1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbSyncTaskProperties.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL DB and target server requirements for online migration + /// + public partial class ConnectToTargetSqlDbSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlDbSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlDbSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.PowerShell.cs new file mode 100644 index 000000000000..9c0407b0fd12 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.PowerShell.cs @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to SQL DB and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbTaskInputTypeConverter))] + public partial class ConnectToTargetSqlDbTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlDbTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("QueryObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).QueryObjectCount = (bool?) content.GetValueForProperty("QueryObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).QueryObjectCount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlDbTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("QueryObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).QueryObjectCount = (bool?) content.GetValueForProperty("QueryObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).QueryObjectCount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlDbTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlDbTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to SQL DB and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbTaskInputTypeConverter))] + public partial interface IConnectToTargetSqlDbTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..2c08a359ca43 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlDbTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlDbTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.cs new file mode 100644 index 000000000000..07c578a9f383 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.cs @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal + { + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private bool? _queryObjectCount; + + /// + /// Boolean flag indicating whether to query object counts for each database on the target server + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? QueryObjectCount { get => this._queryObjectCount; set => this._queryObjectCount = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target SQL DB + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public ConnectToTargetSqlDbTaskInput() + { + + } + } + /// Input for the task that validates connection to SQL DB and target server requirements + public partial interface IConnectToTargetSqlDbTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// Boolean flag indicating whether to query object counts for each database on the target server + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Boolean flag indicating whether to query object counts for each database on the target server", + SerializedName = @"queryObjectCounts", + PossibleTypes = new [] { typeof(bool) })] + bool? QueryObjectCount { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates connection to SQL DB and target server requirements + internal partial interface IConnectToTargetSqlDbTaskInputInternal + + { + /// + /// Boolean flag indicating whether to query object counts for each database on the target server + /// + bool? QueryObjectCount { get; set; } + /// Connection information for target SQL DB + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.json.cs new file mode 100644 index 000000000000..feddb72f67aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskInput.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlDbTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_queryObjectCount = If( json?.PropertyT("queryObjectCounts"), out var __jsonQueryObjectCounts) ? (bool?)__jsonQueryObjectCounts : QueryObjectCount;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlDbTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._queryObjectCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._queryObjectCount) : null, "queryObjectCounts" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..a9675ee05d6f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to SQL DB and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbTaskOutputTypeConverter))] + public partial class ConnectToTargetSqlDbTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlDbTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlDbTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlDbTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlDbTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to SQL DB and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbTaskOutputTypeConverter))] + public partial interface IConnectToTargetSqlDbTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..0e0907788b34 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlDbTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlDbTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.cs new file mode 100644 index 000000000000..214751f3392e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal + { + + /// Backing field for property. + private string _database; + + /// Source databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Database { get => this._database; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Database + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutputInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// Creates an new instance. + public ConnectToTargetSqlDbTaskOutput() + { + + } + } + /// Output for the task that validates connection to SQL DB and target server requirements + public partial interface IConnectToTargetSqlDbTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Source databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source databases as a map from database name to database id", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string Database { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Version of the target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the target server", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + /// Output for the task that validates connection to SQL DB and target server requirements + internal partial interface IConnectToTargetSqlDbTaskOutputInternal + + { + /// Source databases as a map from database name to database id + string Database { get; set; } + /// Result identifier + string Id { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Version of the target server + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.json.cs new file mode 100644 index 000000000000..e5012295d4aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskOutput.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlDbTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? (string)__jsonDatabases : (string)Database;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlDbTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._database)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._database.ToString()) : null, "databases" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..87d8349295d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.PowerShell.cs @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to SQL DB and target server requirements + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbTaskPropertiesTypeConverter))] + public partial class ConnectToTargetSqlDbTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlDbTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputQueryObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputQueryObjectCount = (bool?) content.GetValueForProperty("InputQueryObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputQueryObjectCount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlDbTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputQueryObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputQueryObjectCount = (bool?) content.GetValueForProperty("InputQueryObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).InputQueryObjectCount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlDbTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlDbTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to SQL DB and target server requirements + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlDbTaskPropertiesTypeConverter))] + public partial interface IConnectToTargetSqlDbTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..37c2cc6325ab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlDbTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlDbTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlDbTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.cs new file mode 100644 index 000000000000..eac4221f9659 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.cs @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Backing field for property. + private string _createdOn; + + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CreatedOn { get => this._createdOn; set => this._createdOn = value; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskInput()); set => this._input = value; } + + /// + /// Boolean flag indicating whether to query object counts for each database on the target server + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputQueryObjectCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).QueryObjectCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).QueryObjectCount = value ?? default(bool); } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputTargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal.InputTargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInputInternal)Input).TargetConnectionInfoUserName = value ?? null; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToTargetSqlDbTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to SQL DB and target server requirements + public partial interface IConnectToTargetSqlDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DateTime in UTC when the task was created", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(string) })] + string CreatedOn { get; set; } + /// + /// Boolean flag indicating whether to query object counts for each database on the target server + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Boolean flag indicating whether to query object counts for each database on the target server", + SerializedName = @"queryObjectCounts", + PossibleTypes = new [] { typeof(bool) })] + bool? InputQueryObjectCount { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates connection to SQL DB and target server requirements + internal partial interface IConnectToTargetSqlDbTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// DateTime in UTC when the task was created + string CreatedOn { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskInput Input { get; set; } + /// + /// Boolean flag indicating whether to query object counts for each database on the target server + /// + bool? InputQueryObjectCount { get; set; } + /// Connection information for target SQL DB + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo InputTargetConnectionInfo { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput[] Output { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.json.cs new file mode 100644 index 000000000000..997b6fdc8d30 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlDbTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to SQL DB and target server requirements + /// + public partial class ConnectToTargetSqlDbTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlDbTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlDbTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? (string)__jsonCreatedOn : (string)CreatedOn;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlDbTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlDbTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._createdOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdOn.ToString()) : null, "createdOn" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..6507220e0bd3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.PowerShell.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiSyncTaskInputTypeConverter))] + public partial class ConnectToTargetSqlMiSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlMiSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlMiSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlMiSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlMiSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiSyncTaskInputTypeConverter))] + public partial interface IConnectToTargetSqlMiSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..0f2e220f310a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlMiSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlMiSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.cs new file mode 100644 index 000000000000..fcb140624fef --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. + /// + public partial class ConnectToTargetSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp _azureApp; + + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureApp { get => (this._azureApp = this._azureApp ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp()); set => this._azureApp = value; } + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).ApplicationId = value ?? null; } + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? AzureAppIgnoreAzurePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).IgnoreAzurePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).IgnoreAzurePermission = value ?? default(bool); } + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).AppKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).AppKey = value ?? null; } + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).TenantId = value ?? null; } + + /// Internal Acessors for AzureApp + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal.AzureApp { get => (this._azureApp = this._azureApp ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp()); set { {_azureApp = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo _targetConnectionInfo; + + /// Connection information for Azure SQL Database Managed Instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoManagedInstanceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)TargetConnectionInfo).ManagedInstanceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)TargetConnectionInfo).ManagedInstanceResourceId = value ; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public ConnectToTargetSqlMiSyncTaskInput() + { + + } + } + /// Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. + public partial interface IConnectToTargetSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string AzureAppApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureAppIgnoreAzurePermission { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + string AzureAppKey { get; set; } + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureAppTenantId { get; set; } + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource id for Azure SQL database Managed instance", + SerializedName = @"managedInstanceResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoManagedInstanceResourceId { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. + internal partial interface IConnectToTargetSqlMiSyncTaskInputInternal + + { + /// + /// 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 + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureApp { get; set; } + /// Application ID of the Azure Active Directory Application + string AzureAppApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + bool? AzureAppIgnoreAzurePermission { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + string AzureAppKey { get; set; } + /// Tenant id of the customer + string AzureAppTenantId { get; set; } + /// Connection information for Azure SQL Database Managed Instance + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo TargetConnectionInfo { get; set; } + /// Resource id for Azure SQL database Managed instance + string TargetConnectionInfoManagedInstanceResourceId { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.json.cs new file mode 100644 index 000000000000..34278b7cd820 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskInput.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. + /// + public partial class ConnectToTargetSqlMiSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlMiSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_azureApp = If( json?.PropertyT("azureApp"), out var __jsonAzureApp) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp.FromJson(__jsonAzureApp) : AzureApp;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlMiSyncTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._azureApp ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._azureApp.ToJson(null,serializationMode) : null, "azureApp" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..d7dff72f8b96 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiSyncTaskOutputTypeConverter))] + public partial class ConnectToTargetSqlMiSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlMiSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlMiSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlMiSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlMiSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiSyncTaskOutputTypeConverter))] + public partial interface IConnectToTargetSqlMiSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..bc80a02e7b86 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlMiSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlMiSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.cs new file mode 100644 index 000000000000..762778fcb60e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + /// + public partial class ConnectToTargetSqlMiSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal + { + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public ConnectToTargetSqlMiSyncTaskOutput() + { + + } + } + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + public partial interface IConnectToTargetSqlMiSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + internal partial interface IConnectToTargetSqlMiSyncTaskOutputInternal + + { + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.json.cs new file mode 100644 index 000000000000..d04ebaef2a98 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskOutput.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + /// + public partial class ConnectToTargetSqlMiSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlMiSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlMiSyncTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..1d9d43ade72f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.PowerShell.cs @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiSyncTaskPropertiesTypeConverter))] + public partial class ConnectToTargetSqlMiSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlMiSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputAzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputAzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("InputAzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputAzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlMiSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputAzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputAzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("InputAzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).InputAzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlMiSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlMiSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiSyncTaskPropertiesTypeConverter))] + public partial interface IConnectToTargetSqlMiSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..2de99251b17e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlMiSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlMiSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.cs new file mode 100644 index 000000000000..b7bbef8e8fa3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + /// + public partial class ConnectToTargetSqlMiSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppApplicationId = value ?? null; } + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? AzureAppIgnoreAzurePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppIgnoreAzurePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppIgnoreAzurePermission = value ?? default(bool); } + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppKey = value ?? null; } + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureAppTenantId = value ?? null; } + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputAzureApp + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal.InputAzureApp { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureApp; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).AzureApp = value; } + + /// Internal Acessors for InputTargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal.InputTargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoManagedInstanceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoManagedInstanceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoManagedInstanceResourceId = value ?? null; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoPassword = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInputInternal)Input).TargetConnectionInfoUserName = value ?? null; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToTargetSqlMiSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + public partial interface IConnectToTargetSqlMiSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string AzureAppApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureAppIgnoreAzurePermission { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + string AzureAppKey { get; set; } + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureAppTenantId { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput[] Output { get; } + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource id for Azure SQL database Managed instance", + SerializedName = @"managedInstanceResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoManagedInstanceResourceId { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + internal partial interface IConnectToTargetSqlMiSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Application ID of the Azure Active Directory Application + string AzureAppApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + bool? AzureAppIgnoreAzurePermission { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + string AzureAppKey { get; set; } + /// Tenant id of the customer + string AzureAppTenantId { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskInput Input { get; set; } + /// + /// 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 + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp InputAzureApp { get; set; } + /// Connection information for Azure SQL Database Managed Instance + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo InputTargetConnectionInfo { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput[] Output { get; set; } + /// Resource id for Azure SQL database Managed instance + string TargetConnectionInfoManagedInstanceResourceId { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.json.cs new file mode 100644 index 000000000000..88600cb0d1bf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiSyncTaskProperties.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + /// + public partial class ConnectToTargetSqlMiSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlMiSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlMiSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.PowerShell.cs new file mode 100644 index 000000000000..cb134d0c4700 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.PowerShell.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that validates connection to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiTaskInputTypeConverter))] + public partial class ConnectToTargetSqlMiTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlMiTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectLogin = (bool?) content.GetValueForProperty("CollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectAgentJob = (bool?) content.GetValueForProperty("CollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).ValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("ValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).ValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlMiTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectLogin = (bool?) content.GetValueForProperty("CollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectAgentJob = (bool?) content.GetValueForProperty("CollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).CollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).ValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("ValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).ValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlMiTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlMiTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that validates connection to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiTaskInputTypeConverter))] + public partial interface IConnectToTargetSqlMiTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..18e999645996 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlMiTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlMiTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.cs new file mode 100644 index 000000000000..9a8a79fa20b8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure SQL Database Managed Instance. + /// + public partial class ConnectToTargetSqlMiTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal + { + + /// Backing field for property. + private bool? _collectAgentJob; + + /// Flag for whether to collect agent jobs from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? CollectAgentJob { get => this._collectAgentJob; set => this._collectAgentJob = value; } + + /// Backing field for property. + private bool? _collectLogin; + + /// Flag for whether to collect logins from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? CollectLogin { get => this._collectLogin; set => this._collectLogin = value; } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private bool? _validateSsisCatalogOnly; + + /// + /// Flag for whether to validate SSIS catalog is reachable on the target SQL MI server. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? ValidateSsisCatalogOnly { get => this._validateSsisCatalogOnly; set => this._validateSsisCatalogOnly = value; } + + /// Creates an new instance. + public ConnectToTargetSqlMiTaskInput() + { + + } + } + /// Input for the task that validates connection to Azure SQL Database Managed Instance. + public partial interface IConnectToTargetSqlMiTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Flag for whether to collect agent jobs from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect agent jobs from target SQL MI server.", + SerializedName = @"collectAgentJobs", + PossibleTypes = new [] { typeof(bool) })] + bool? CollectAgentJob { get; set; } + /// Flag for whether to collect logins from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect logins from target SQL MI server.", + SerializedName = @"collectLogins", + PossibleTypes = new [] { typeof(bool) })] + bool? CollectLogin { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + /// + /// Flag for whether to validate SSIS catalog is reachable on the target SQL MI server. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to validate SSIS catalog is reachable on the target SQL MI server.", + SerializedName = @"validateSsisCatalogOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidateSsisCatalogOnly { get; set; } + + } + /// Input for the task that validates connection to Azure SQL Database Managed Instance. + internal partial interface IConnectToTargetSqlMiTaskInputInternal + + { + /// Flag for whether to collect agent jobs from target SQL MI server. + bool? CollectAgentJob { get; set; } + /// Flag for whether to collect logins from target SQL MI server. + bool? CollectLogin { get; set; } + /// Connection information for target SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + /// + /// Flag for whether to validate SSIS catalog is reachable on the target SQL MI server. + /// + bool? ValidateSsisCatalogOnly { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.json.cs new file mode 100644 index 000000000000..7622ec2bec28 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskInput.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that validates connection to Azure SQL Database Managed Instance. + /// + public partial class ConnectToTargetSqlMiTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlMiTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_collectLogin = If( json?.PropertyT("collectLogins"), out var __jsonCollectLogins) ? (bool?)__jsonCollectLogins : CollectLogin;} + {_collectAgentJob = If( json?.PropertyT("collectAgentJobs"), out var __jsonCollectAgentJobs) ? (bool?)__jsonCollectAgentJobs : CollectAgentJob;} + {_validateSsisCatalogOnly = If( json?.PropertyT("validateSsisCatalogOnly"), out var __jsonValidateSsisCatalogOnly) ? (bool?)__jsonValidateSsisCatalogOnly : ValidateSsisCatalogOnly;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlMiTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._collectLogin ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._collectLogin) : null, "collectLogins" ,container.Add ); + AddIf( null != this._collectAgentJob ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._collectAgentJob) : null, "collectAgentJobs" ,container.Add ); + AddIf( null != this._validateSsisCatalogOnly ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._validateSsisCatalogOnly) : null, "validateSsisCatalogOnly" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..7373122020f9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiTaskOutputTypeConverter))] + public partial class ConnectToTargetSqlMiTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlMiTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Login = (string[]) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Login, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).AgentJob = (string[]) content.GetValueForProperty("AgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).AgentJob, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlMiTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Login = (string[]) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).Login, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).AgentJob = (string[]) content.GetValueForProperty("AgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).AgentJob, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlMiTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlMiTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiTaskOutputTypeConverter))] + public partial interface IConnectToTargetSqlMiTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..b8bebbca5575 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlMiTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlMiTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.cs new file mode 100644 index 000000000000..a751a64cf213 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + /// + public partial class ConnectToTargetSqlMiTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal + { + + /// Backing field for property. + private string[] _agentJob; + + /// List of agent jobs on the target server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] AgentJob { get => this._agentJob; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private string[] _login; + + /// List of logins on the target server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Login { get => this._login; } + + /// Internal Acessors for AgentJob + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal.AgentJob { get => this._agentJob; set { {_agentJob = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Login + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal.Login { get => this._login; set { {_login = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public ConnectToTargetSqlMiTaskOutput() + { + + } + } + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + public partial interface IConnectToTargetSqlMiTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of agent jobs on the target server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of agent jobs on the target server.", + SerializedName = @"agentJobs", + PossibleTypes = new [] { typeof(string) })] + string[] AgentJob { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// List of logins on the target server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of logins on the target server.", + SerializedName = @"logins", + PossibleTypes = new [] { typeof(string) })] + string[] Login { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + internal partial interface IConnectToTargetSqlMiTaskOutputInternal + + { + /// List of agent jobs on the target server. + string[] AgentJob { get; set; } + /// Result identifier + string Id { get; set; } + /// List of logins on the target server. + string[] Login { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.json.cs new file mode 100644 index 000000000000..679d7cdb8597 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskOutput.json.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that validates connection to Azure SQL Database Managed Instance. + /// + public partial class ConnectToTargetSqlMiTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlMiTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_login = If( json?.PropertyT("logins"), out var __jsonLogins) ? If( __jsonLogins as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Login;} + {_agentJob = If( json?.PropertyT("agentJobs"), out var __jsonAgentJobs) ? If( __jsonAgentJobs as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : AgentJob;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__k) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlMiTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._login) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._login ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("logins",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._agentJob) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._agentJob ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("agentJobs",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __n in this._validationError ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("validationErrors",__m); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..5b14df421379 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.PowerShell.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + /// + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiTaskPropertiesTypeConverter))] + public partial class ConnectToTargetSqlMiTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectToTargetSqlMiTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputCollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectLogin = (bool?) content.GetValueForProperty("InputCollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectAgentJob = (bool?) content.GetValueForProperty("InputCollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("InputValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectToTargetSqlMiTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputCollectLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectLogin = (bool?) content.GetValueForProperty("InputCollectLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectLogin, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputCollectAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectAgentJob = (bool?) content.GetValueForProperty("InputCollectAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputCollectAgentJob, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("InputValidateSsisCatalogOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputValidateSsisCatalogOnly = (bool?) content.GetValueForProperty("InputValidateSsisCatalogOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).InputValidateSsisCatalogOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectToTargetSqlMiTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectToTargetSqlMiTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + [System.ComponentModel.TypeConverter(typeof(ConnectToTargetSqlMiTaskPropertiesTypeConverter))] + public partial interface IConnectToTargetSqlMiTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..feb575722479 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectToTargetSqlMiTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectToTargetSqlMiTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectToTargetSqlMiTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.cs new file mode 100644 index 000000000000..a1439b64e2ba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.cs @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + /// + public partial class ConnectToTargetSqlMiTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskInput()); set => this._input = value; } + + /// Flag for whether to collect agent jobs from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectAgentJob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).CollectAgentJob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).CollectAgentJob = value ?? default(bool); } + + /// Flag for whether to collect logins from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputCollectLogin { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).CollectLogin; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).CollectLogin = value ?? default(bool); } + + /// + /// Flag for whether to validate SSIS catalog is reachable on the target SQL MI server. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputValidateSsisCatalogOnly { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).ValidateSsisCatalogOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).ValidateSsisCatalogOnly = value ?? default(bool); } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputTargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal.InputTargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInputInternal)Input).TargetConnectionInfoUserName = value ?? null; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public ConnectToTargetSqlMiTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + public partial interface IConnectToTargetSqlMiTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Flag for whether to collect agent jobs from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect agent jobs from target SQL MI server.", + SerializedName = @"collectAgentJobs", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectAgentJob { get; set; } + /// Flag for whether to collect logins from target SQL MI server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to collect logins from target SQL MI server.", + SerializedName = @"collectLogins", + PossibleTypes = new [] { typeof(bool) })] + bool? InputCollectLogin { get; set; } + /// + /// Flag for whether to validate SSIS catalog is reachable on the target SQL MI server. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag for whether to validate SSIS catalog is reachable on the target SQL MI server.", + SerializedName = @"validateSsisCatalogOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? InputValidateSsisCatalogOnly { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + internal partial interface IConnectToTargetSqlMiTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskInput Input { get; set; } + /// Flag for whether to collect agent jobs from target SQL MI server. + bool? InputCollectAgentJob { get; set; } + /// Flag for whether to collect logins from target SQL MI server. + bool? InputCollectLogin { get; set; } + /// Connection information for target SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo InputTargetConnectionInfo { get; set; } + /// + /// Flag for whether to validate SSIS catalog is reachable on the target SQL MI server. + /// + bool? InputValidateSsisCatalogOnly { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput[] Output { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.json.cs new file mode 100644 index 000000000000..2a69cb69241d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectToTargetSqlMiTaskProperties.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates connection to Azure SQL Database Managed Instance + /// + public partial class ConnectToTargetSqlMiTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectToTargetSqlMiTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectToTargetSqlMiTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectToTargetSqlMiTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ConnectToTargetSqlMiTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.PowerShell.cs new file mode 100644 index 000000000000..435d4923816e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Defines the connection properties of a server + [System.ComponentModel.TypeConverter(typeof(ConnectionInfoTypeConverter))] + public partial class ConnectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Defines the connection properties of a server + [System.ComponentModel.TypeConverter(typeof(ConnectionInfoTypeConverter))] + public partial interface IConnectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..ae79f996ebf3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.cs new file mode 100644 index 000000000000..7e2bd4c05c0f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Defines the connection properties of a server + public partial class ConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal + { + + /// Backing field for property. + private string _password; + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Password { get => this._password; set => this._password = value; } + + /// Backing field for property. + private string _type; + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private string _userName; + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string UserName { get => this._userName; set => this._userName = value; } + + /// Creates an new instance. + public ConnectionInfo() + { + + } + } + /// Defines the connection properties of a server + public partial interface IConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string UserName { get; set; } + + } + /// Defines the connection properties of a server + internal partial interface IConnectionInfoInternal + + { + /// Password credential. + string Password { get; set; } + /// Type of connection info + string Type { get; set; } + /// User name + string UserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.json.cs new file mode 100644 index 000000000000..0092ab7d75b5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ConnectionInfo.json.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Defines the connection properties of a server + public partial class ConnectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)UserName;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("type") ) + { + case "MongoDbConnectionInfo": + { + return new MongoDbConnectionInfo(json); + } + case "SqlConnectionInfo": + { + return new SqlConnectionInfo(json); + } + case "MySqlConnectionInfo": + { + return new MySqlConnectionInfo(json); + } + case "OracleConnectionInfo": + { + return new OracleConnectionInfo(json); + } + case "PostgreSqlConnectionInfo": + { + return new PostgreSqlConnectionInfo(json); + } + case "MiSqlConnectionInfo": + { + return new MiSqlConnectionInfo(json); + } + } + return new ConnectionInfo(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.PowerShell.cs new file mode 100644 index 000000000000..6f3345858a6e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Details on progress of ADF copy activity + [System.ComponentModel.TypeConverter(typeof(CopyProgressDetailsTypeConverter))] + public partial class CopyProgressDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CopyProgressDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ParallelCopyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).ParallelCopyType = (string) content.GetValueForProperty("ParallelCopyType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).ParallelCopyType, global::System.Convert.ToString); + } + if (content.Contains("UsedParallelCopy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).UsedParallelCopy = (int?) content.GetValueForProperty("UsedParallelCopy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).UsedParallelCopy, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DataRead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataRead = (long?) content.GetValueForProperty("DataRead",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataRead, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataWritten")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataWritten = (long?) content.GetValueForProperty("DataWritten",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataWritten, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RowsRead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsRead = (long?) content.GetValueForProperty("RowsRead",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsRead, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RowsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsCopied = (long?) content.GetValueForProperty("RowsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CopyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyStart = (global::System.DateTime?) content.GetValueForProperty("CopyStart",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CopyThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyThroughput = (double?) content.GetValueForProperty("CopyThroughput",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyThroughput, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("CopyDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyDuration = (int?) content.GetValueForProperty("CopyDuration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CopyProgressDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ParallelCopyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).ParallelCopyType = (string) content.GetValueForProperty("ParallelCopyType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).ParallelCopyType, global::System.Convert.ToString); + } + if (content.Contains("UsedParallelCopy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).UsedParallelCopy = (int?) content.GetValueForProperty("UsedParallelCopy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).UsedParallelCopy, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DataRead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataRead = (long?) content.GetValueForProperty("DataRead",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataRead, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataWritten")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataWritten = (long?) content.GetValueForProperty("DataWritten",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).DataWritten, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RowsRead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsRead = (long?) content.GetValueForProperty("RowsRead",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsRead, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RowsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsCopied = (long?) content.GetValueForProperty("RowsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).RowsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CopyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyStart = (global::System.DateTime?) content.GetValueForProperty("CopyStart",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CopyThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyThroughput = (double?) content.GetValueForProperty("CopyThroughput",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyThroughput, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("CopyDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyDuration = (int?) content.GetValueForProperty("CopyDuration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal)this).CopyDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CopyProgressDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CopyProgressDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details on progress of ADF copy activity + [System.ComponentModel.TypeConverter(typeof(CopyProgressDetailsTypeConverter))] + public partial interface ICopyProgressDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.TypeConverter.cs new file mode 100644 index 000000000000..36bde2cdd48f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CopyProgressDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CopyProgressDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CopyProgressDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CopyProgressDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.cs new file mode 100644 index 000000000000..caafa6c485f5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Details on progress of ADF copy activity + public partial class CopyProgressDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal + { + + /// Backing field for property. + private int? _copyDuration; + + /// Copy Duration in seconds + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? CopyDuration { get => this._copyDuration; } + + /// Backing field for property. + private global::System.DateTime? _copyStart; + + /// Copy Start + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? CopyStart { get => this._copyStart; } + + /// Backing field for property. + private double? _copyThroughput; + + /// Copy throughput in KBps + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? CopyThroughput { get => this._copyThroughput; } + + /// Backing field for property. + private long? _dataRead; + + /// Bytes read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataRead { get => this._dataRead; } + + /// Backing field for property. + private long? _dataWritten; + + /// Bytes written + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataWritten { get => this._dataWritten; } + + /// Internal Acessors for CopyDuration + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.CopyDuration { get => this._copyDuration; set { {_copyDuration = value;} } } + + /// Internal Acessors for CopyStart + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.CopyStart { get => this._copyStart; set { {_copyStart = value;} } } + + /// Internal Acessors for CopyThroughput + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.CopyThroughput { get => this._copyThroughput; set { {_copyThroughput = value;} } } + + /// Internal Acessors for DataRead + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.DataRead { get => this._dataRead; set { {_dataRead = value;} } } + + /// Internal Acessors for DataWritten + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.DataWritten { get => this._dataWritten; set { {_dataWritten = value;} } } + + /// Internal Acessors for ParallelCopyType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.ParallelCopyType { get => this._parallelCopyType; set { {_parallelCopyType = value;} } } + + /// Internal Acessors for RowsCopied + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.RowsCopied { get => this._rowsCopied; set { {_rowsCopied = value;} } } + + /// Internal Acessors for RowsRead + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.RowsRead { get => this._rowsRead; set { {_rowsRead = value;} } } + + /// Internal Acessors for Status + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TableName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.TableName { get => this._tableName; set { {_tableName = value;} } } + + /// Internal Acessors for UsedParallelCopy + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetailsInternal.UsedParallelCopy { get => this._usedParallelCopy; set { {_usedParallelCopy = value;} } } + + /// Backing field for property. + private string _parallelCopyType; + + /// Type of parallel copy (Dynamic range, Physical partition, none). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ParallelCopyType { get => this._parallelCopyType; } + + /// Backing field for property. + private long? _rowsCopied; + + /// Rows Copied + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? RowsCopied { get => this._rowsCopied; } + + /// Backing field for property. + private long? _rowsRead; + + /// Rows read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? RowsRead { get => this._rowsRead; } + + /// Backing field for property. + private string _status; + + /// Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Status { get => this._status; } + + /// Backing field for property. + private string _tableName; + + /// Table Name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TableName { get => this._tableName; } + + /// Backing field for property. + private int? _usedParallelCopy; + + /// The degree of parallelization. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? UsedParallelCopy { get => this._usedParallelCopy; } + + /// Creates an new instance. + public CopyProgressDetails() + { + + } + } + /// Details on progress of ADF copy activity + public partial interface ICopyProgressDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Copy Duration in seconds + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Copy Duration in seconds", + SerializedName = @"copyDuration", + PossibleTypes = new [] { typeof(int) })] + int? CopyDuration { get; } + /// Copy Start + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Copy Start", + SerializedName = @"copyStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CopyStart { get; } + /// Copy throughput in KBps + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Copy throughput in KBps", + SerializedName = @"copyThroughput", + PossibleTypes = new [] { typeof(double) })] + double? CopyThroughput { get; } + /// Bytes read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Bytes read", + SerializedName = @"dataRead", + PossibleTypes = new [] { typeof(long) })] + long? DataRead { get; } + /// Bytes written + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Bytes written", + SerializedName = @"dataWritten", + PossibleTypes = new [] { typeof(long) })] + long? DataWritten { get; } + /// Type of parallel copy (Dynamic range, Physical partition, none). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of parallel copy (Dynamic range, Physical partition, none).", + SerializedName = @"parallelCopyType", + PossibleTypes = new [] { typeof(string) })] + string ParallelCopyType { get; } + /// Rows Copied + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Rows Copied", + SerializedName = @"rowsCopied", + PossibleTypes = new [] { typeof(long) })] + long? RowsCopied { get; } + /// Rows read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Rows read", + SerializedName = @"rowsRead", + PossibleTypes = new [] { typeof(long) })] + long? RowsRead { get; } + /// Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status of the Copy activity (InProgress, Succeeded, Failed, Canceled).", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; } + /// Table Name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Table Name", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string TableName { get; } + /// The degree of parallelization. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The degree of parallelization.", + SerializedName = @"usedParallelCopies", + PossibleTypes = new [] { typeof(int) })] + int? UsedParallelCopy { get; } + + } + /// Details on progress of ADF copy activity + internal partial interface ICopyProgressDetailsInternal + + { + /// Copy Duration in seconds + int? CopyDuration { get; set; } + /// Copy Start + global::System.DateTime? CopyStart { get; set; } + /// Copy throughput in KBps + double? CopyThroughput { get; set; } + /// Bytes read + long? DataRead { get; set; } + /// Bytes written + long? DataWritten { get; set; } + /// Type of parallel copy (Dynamic range, Physical partition, none). + string ParallelCopyType { get; set; } + /// Rows Copied + long? RowsCopied { get; set; } + /// Rows read + long? RowsRead { get; set; } + /// Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + string Status { get; set; } + /// Table Name + string TableName { get; set; } + /// The degree of parallelization. + int? UsedParallelCopy { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.json.cs new file mode 100644 index 000000000000..3f3b2392baf3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/CopyProgressDetails.json.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Details on progress of ADF copy activity + public partial class CopyProgressDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal CopyProgressDetails(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_parallelCopyType = If( json?.PropertyT("parallelCopyType"), out var __jsonParallelCopyType) ? (string)__jsonParallelCopyType : (string)ParallelCopyType;} + {_usedParallelCopy = If( json?.PropertyT("usedParallelCopies"), out var __jsonUsedParallelCopies) ? (int?)__jsonUsedParallelCopies : UsedParallelCopy;} + {_dataRead = If( json?.PropertyT("dataRead"), out var __jsonDataRead) ? (long?)__jsonDataRead : DataRead;} + {_dataWritten = If( json?.PropertyT("dataWritten"), out var __jsonDataWritten) ? (long?)__jsonDataWritten : DataWritten;} + {_rowsRead = If( json?.PropertyT("rowsRead"), out var __jsonRowsRead) ? (long?)__jsonRowsRead : RowsRead;} + {_rowsCopied = If( json?.PropertyT("rowsCopied"), out var __jsonRowsCopied) ? (long?)__jsonRowsCopied : RowsCopied;} + {_copyStart = If( json?.PropertyT("copyStart"), out var __jsonCopyStart) ? global::System.DateTime.TryParse((string)__jsonCopyStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCopyStartValue) ? __jsonCopyStartValue : CopyStart : CopyStart;} + {_copyThroughput = If( json?.PropertyT("copyThroughput"), out var __jsonCopyThroughput) ? (double?)__jsonCopyThroughput : CopyThroughput;} + {_copyDuration = If( json?.PropertyT("copyDuration"), out var __jsonCopyDuration) ? (int?)__jsonCopyDuration : CopyDuration;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new CopyProgressDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tableName.ToString()) : null, "tableName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._parallelCopyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._parallelCopyType.ToString()) : null, "parallelCopyType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usedParallelCopy ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._usedParallelCopy) : null, "usedParallelCopies" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataRead ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataRead) : null, "dataRead" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataWritten ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataWritten) : null, "dataWritten" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._rowsRead ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._rowsRead) : null, "rowsRead" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._rowsCopied ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._rowsCopied) : null, "rowsCopied" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._copyStart ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._copyStart?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "copyStart" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._copyThroughput ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._copyThroughput) : null, "copyThroughput" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._copyDuration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._copyDuration) : null, "copyDuration" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.PowerShell.cs new file mode 100644 index 000000000000..db190abfa376 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Results for checksum based Data Integrity validation results + [System.ComponentModel.TypeConverter(typeof(DataIntegrityValidationResultTypeConverter))] + public partial class DataIntegrityValidationResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataIntegrityValidationResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("FailedObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).FailedObject = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) content.GetValueForProperty("FailedObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).FailedObject, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjectsTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationErrorSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("ValidationErrorSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("ValidationErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorText = (string) content.GetValueForProperty("ValidationErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorText, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataIntegrityValidationResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("FailedObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).FailedObject = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) content.GetValueForProperty("FailedObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).FailedObject, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjectsTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationErrorSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("ValidationErrorSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("ValidationErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorText = (string) content.GetValueForProperty("ValidationErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)this).ValidationErrorText, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataIntegrityValidationResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataIntegrityValidationResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Results for checksum based Data Integrity validation results + [System.ComponentModel.TypeConverter(typeof(DataIntegrityValidationResultTypeConverter))] + public partial interface IDataIntegrityValidationResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.TypeConverter.cs new file mode 100644 index 000000000000..d1bd5b0e25e8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataIntegrityValidationResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataIntegrityValidationResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataIntegrityValidationResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataIntegrityValidationResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.cs new file mode 100644 index 000000000000..b60868c3149d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Results for checksum based Data Integrity validation results + public partial class DataIntegrityValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects _failedObject; + + /// List of failed table names of source and target pair + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects FailedObject { get => (this._failedObject = this._failedObject ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjects()); set => this._failedObject = value; } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal.ValidationError { get => (this._validationError = this._validationError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError()); set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError _validationError; + + /// List of errors that happened while performing data integrity validation + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError ValidationError { get => (this._validationError = this._validationError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError()); set => this._validationError = value; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Severity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ValidationErrorText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Text = value ?? null; } + + /// Creates an new instance. + public DataIntegrityValidationResult() + { + + } + } + /// Results for checksum based Data Integrity validation results + public partial interface IDataIntegrityValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of failed table names of source and target pair + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of failed table names of source and target pair", + SerializedName = @"failedObjects", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects FailedObject { get; set; } + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the error", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get; set; } + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Text", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string ValidationErrorText { get; set; } + + } + /// Results for checksum based Data Integrity validation results + internal partial interface IDataIntegrityValidationResultInternal + + { + /// List of failed table names of source and target pair + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects FailedObject { get; set; } + /// List of errors that happened while performing data integrity validation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError ValidationError { get; set; } + /// Severity of the error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get; set; } + /// Error Text + string ValidationErrorText { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.json.cs new file mode 100644 index 000000000000..427c468ac249 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResult.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Results for checksum based Data Integrity validation results + public partial class DataIntegrityValidationResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataIntegrityValidationResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError.FromJson(__jsonValidationErrors) : ValidationError;} + {_failedObject = If( json?.PropertyT("failedObjects"), out var __jsonFailedObjects) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjects.FromJson(__jsonFailedObjects) : FailedObject;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataIntegrityValidationResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._validationError ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._validationError.ToJson(null,serializationMode) : null, "validationErrors" ,container.Add ); + AddIf( null != this._failedObject ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._failedObject.ToJson(null,serializationMode) : null, "failedObjects" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.PowerShell.cs new file mode 100644 index 000000000000..a534df394562 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// List of failed table names of source and target pair + [System.ComponentModel.TypeConverter(typeof(DataIntegrityValidationResultFailedObjectsTypeConverter))] + public partial class DataIntegrityValidationResultFailedObjects + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataIntegrityValidationResultFailedObjects(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataIntegrityValidationResultFailedObjects(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataIntegrityValidationResultFailedObjects(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataIntegrityValidationResultFailedObjects(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of failed table names of source and target pair + [System.ComponentModel.TypeConverter(typeof(DataIntegrityValidationResultFailedObjectsTypeConverter))] + public partial interface IDataIntegrityValidationResultFailedObjects + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.TypeConverter.cs new file mode 100644 index 000000000000..ae814cd207ac --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataIntegrityValidationResultFailedObjectsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataIntegrityValidationResultFailedObjects.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataIntegrityValidationResultFailedObjects.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataIntegrityValidationResultFailedObjects.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.cs new file mode 100644 index 000000000000..3d8843e269c2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// List of failed table names of source and target pair + public partial class DataIntegrityValidationResultFailedObjects : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjectsInternal + { + + /// + /// Creates an new instance. + /// + public DataIntegrityValidationResultFailedObjects() + { + + } + } + /// List of failed table names of source and target pair + public partial interface IDataIntegrityValidationResultFailedObjects : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// List of failed table names of source and target pair + internal partial interface IDataIntegrityValidationResultFailedObjectsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.dictionary.cs new file mode 100644 index 000000000000..2f8db058f570 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class DataIntegrityValidationResultFailedObjects : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjects source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.json.cs new file mode 100644 index 000000000000..77b69302c7b1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataIntegrityValidationResultFailedObjects.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// List of failed table names of source and target pair + public partial class DataIntegrityValidationResultFailedObjects + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DataIntegrityValidationResultFailedObjects(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataIntegrityValidationResultFailedObjects(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.PowerShell.cs new file mode 100644 index 000000000000..826f90cafd86 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Basic summary of a data item migration + [System.ComponentModel.TypeConverter(typeof(DataItemMigrationSummaryResultTypeConverter))] + public partial class DataItemMigrationSummaryResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataItemMigrationSummaryResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataItemMigrationSummaryResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataItemMigrationSummaryResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataItemMigrationSummaryResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Basic summary of a data item migration + [System.ComponentModel.TypeConverter(typeof(DataItemMigrationSummaryResultTypeConverter))] + public partial interface IDataItemMigrationSummaryResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.TypeConverter.cs new file mode 100644 index 000000000000..11a2067f9248 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataItemMigrationSummaryResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataItemMigrationSummaryResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataItemMigrationSummaryResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataItemMigrationSummaryResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.cs new file mode 100644 index 000000000000..cdcb0717632a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Basic summary of a data item migration + public partial class DataItemMigrationSummaryResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal + { + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private string _errorPrefix; + + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorPrefix { get => this._errorPrefix; } + + /// Backing field for property. + private long? _itemsCompletedCount; + + /// Number of successfully completed items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ItemsCompletedCount { get => this._itemsCompletedCount; } + + /// Backing field for property. + private long? _itemsCount; + + /// Number of items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ItemsCount { get => this._itemsCount; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ErrorPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ErrorPrefix { get => this._errorPrefix; set { {_errorPrefix = value;} } } + + /// Internal Acessors for ItemsCompletedCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ItemsCompletedCount { get => this._itemsCompletedCount; set { {_itemsCompletedCount = value;} } } + + /// Internal Acessors for ItemsCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ItemsCount { get => this._itemsCount; set { {_itemsCount = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ResultPrefix { get => this._resultPrefix; set { {_resultPrefix = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _resultPrefix; + + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultPrefix { get => this._resultPrefix; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private string _statusMessage; + + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StatusMessage { get => this._statusMessage; } + + /// Creates an new instance. + public DataItemMigrationSummaryResult() + { + + } + } + /// Basic summary of a data item migration + public partial interface IDataItemMigrationSummaryResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all errors of the item", + SerializedName = @"errorPrefix", + PossibleTypes = new [] { typeof(string) })] + string ErrorPrefix { get; } + /// Number of successfully completed items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of successfully completed items", + SerializedName = @"itemsCompletedCount", + PossibleTypes = new [] { typeof(long) })] + long? ItemsCompletedCount { get; } + /// Number of items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of items", + SerializedName = @"itemsCount", + PossibleTypes = new [] { typeof(long) })] + long? ItemsCount { get; } + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the item", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all sub-tem results of the item", + SerializedName = @"resultPrefix", + PossibleTypes = new [] { typeof(string) })] + string ResultPrefix { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status message", + SerializedName = @"statusMessage", + PossibleTypes = new [] { typeof(string) })] + string StatusMessage { get; } + + } + /// Basic summary of a data item migration + internal partial interface IDataItemMigrationSummaryResultInternal + + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Wildcard string prefix to use for querying all errors of the item + string ErrorPrefix { get; set; } + /// Number of successfully completed items + long? ItemsCompletedCount { get; set; } + /// Number of items + long? ItemsCount { get; set; } + /// Name of the item + string Name { get; set; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + string ResultPrefix { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Status message + string StatusMessage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.json.cs new file mode 100644 index 000000000000..9fd9bfd892cb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataItemMigrationSummaryResult.json.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Basic summary of a data item migration + public partial class DataItemMigrationSummaryResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataItemMigrationSummaryResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_itemsCount = If( json?.PropertyT("itemsCount"), out var __jsonItemsCount) ? (long?)__jsonItemsCount : ItemsCount;} + {_itemsCompletedCount = If( json?.PropertyT("itemsCompletedCount"), out var __jsonItemsCompletedCount) ? (long?)__jsonItemsCompletedCount : ItemsCompletedCount;} + {_errorPrefix = If( json?.PropertyT("errorPrefix"), out var __jsonErrorPrefix) ? (string)__jsonErrorPrefix : (string)ErrorPrefix;} + {_resultPrefix = If( json?.PropertyT("resultPrefix"), out var __jsonResultPrefix) ? (string)__jsonResultPrefix : (string)ResultPrefix;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataItemMigrationSummaryResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._itemsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._itemsCount) : null, "itemsCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._itemsCompletedCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._itemsCompletedCount) : null, "itemsCompletedCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorPrefix.ToString()) : null, "errorPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resultPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultPrefix.ToString()) : null, "resultPrefix" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.PowerShell.cs new file mode 100644 index 000000000000..9492c09cb719 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration Task errors + [System.ComponentModel.TypeConverter(typeof(DataMigrationErrorTypeConverter))] + public partial class DataMigrationError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataMigrationError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataMigrationError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataMigrationError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataMigrationError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration Task errors + [System.ComponentModel.TypeConverter(typeof(DataMigrationErrorTypeConverter))] + public partial interface IDataMigrationError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.TypeConverter.cs new file mode 100644 index 000000000000..64d3d1c17320 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataMigrationErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataMigrationError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataMigrationError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataMigrationError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.cs new file mode 100644 index 000000000000..7eee867ab23d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Task errors + public partial class DataMigrationError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal + { + + /// Backing field for property. + private string _message; + + /// Error description + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationErrorInternal.Message { get => this._message; set { {_message = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType? _type; + + /// Error type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public DataMigrationError() + { + + } + } + /// Migration Task errors + public partial interface IDataMigrationError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Error description + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error description", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Error type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType? Type { get; set; } + + } + /// Migration Task errors + internal partial interface IDataMigrationErrorInternal + + { + /// Error description + string Message { get; set; } + /// Error type + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.json.cs new file mode 100644 index 000000000000..06134a11c3f8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationError.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Task errors + public partial class DataMigrationError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataMigrationError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataMigrationError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.PowerShell.cs new file mode 100644 index 000000000000..1d590b9e4f2d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Common metadata for migration projects + [System.ComponentModel.TypeConverter(typeof(DataMigrationProjectMetadataTypeConverter))] + public partial class DataMigrationProjectMetadata + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataMigrationProjectMetadata(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerPort = (string) content.GetValueForProperty("SourceServerPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerPort, global::System.Convert.ToString); + } + if (content.Contains("SourceUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceUsername = (string) content.GetValueForProperty("SourceUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceUsername, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsername = (string) content.GetValueForProperty("TargetUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsername, global::System.Convert.ToString); + } + if (content.Contains("TargetDbName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetDbName = (string) content.GetValueForProperty("TargetDbName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetDbName, global::System.Convert.ToString); + } + if (content.Contains("TargetUsingWinAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsingWinAuth = (bool?) content.GetValueForProperty("TargetUsingWinAuth",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsingWinAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SelectedMigrationTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SelectedMigrationTable = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata[]) content.GetValueForProperty("SelectedMigrationTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SelectedMigrationTable, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationTableMetadataTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataMigrationProjectMetadata(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerPort = (string) content.GetValueForProperty("SourceServerPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceServerPort, global::System.Convert.ToString); + } + if (content.Contains("SourceUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceUsername = (string) content.GetValueForProperty("SourceUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SourceUsername, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsername = (string) content.GetValueForProperty("TargetUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsername, global::System.Convert.ToString); + } + if (content.Contains("TargetDbName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetDbName = (string) content.GetValueForProperty("TargetDbName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetDbName, global::System.Convert.ToString); + } + if (content.Contains("TargetUsingWinAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsingWinAuth = (bool?) content.GetValueForProperty("TargetUsingWinAuth",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).TargetUsingWinAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SelectedMigrationTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SelectedMigrationTable = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata[]) content.GetValueForProperty("SelectedMigrationTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal)this).SelectedMigrationTable, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationTableMetadataTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataMigrationProjectMetadata(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataMigrationProjectMetadata(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Common metadata for migration projects + [System.ComponentModel.TypeConverter(typeof(DataMigrationProjectMetadataTypeConverter))] + public partial interface IDataMigrationProjectMetadata + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.TypeConverter.cs new file mode 100644 index 000000000000..89e941219fdc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataMigrationProjectMetadataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataMigrationProjectMetadata.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataMigrationProjectMetadata.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataMigrationProjectMetadata.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.cs new file mode 100644 index 000000000000..373506d4014d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Common metadata for migration projects + public partial class DataMigrationProjectMetadata : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal + { + + /// Internal Acessors for SelectedMigrationTable + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.SelectedMigrationTable { get => this._selectedMigrationTable; set { {_selectedMigrationTable = value;} } } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.SourceServerName { get => this._sourceServerName; set { {_sourceServerName = value;} } } + + /// Internal Acessors for SourceServerPort + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.SourceServerPort { get => this._sourceServerPort; set { {_sourceServerPort = value;} } } + + /// Internal Acessors for SourceUsername + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.SourceUsername { get => this._sourceUsername; set { {_sourceUsername = value;} } } + + /// Internal Acessors for TargetDbName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.TargetDbName { get => this._targetDbName; set { {_targetDbName = value;} } } + + /// Internal Acessors for TargetServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.TargetServerName { get => this._targetServerName; set { {_targetServerName = value;} } } + + /// Internal Acessors for TargetUsername + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.TargetUsername { get => this._targetUsername; set { {_targetUsername = value;} } } + + /// Internal Acessors for TargetUsingWinAuth + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadataInternal.TargetUsingWinAuth { get => this._targetUsingWinAuth; set { {_targetUsingWinAuth = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata[] _selectedMigrationTable; + + /// List of tables selected for migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata[] SelectedMigrationTable { get => this._selectedMigrationTable; } + + /// Backing field for property. + private string _sourceServerName; + + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerName { get => this._sourceServerName; } + + /// Backing field for property. + private string _sourceServerPort; + + /// Source server port number + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerPort { get => this._sourceServerPort; } + + /// Backing field for property. + private string _sourceUsername; + + /// Source username + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceUsername { get => this._sourceUsername; } + + /// Backing field for property. + private string _targetDbName; + + /// Target database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDbName { get => this._targetDbName; } + + /// Backing field for property. + private string _targetServerName; + + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerName { get => this._targetServerName; } + + /// Backing field for property. + private string _targetUsername; + + /// Target username + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetUsername { get => this._targetUsername; } + + /// Backing field for property. + private bool? _targetUsingWinAuth; + + /// Whether target connection is Windows authentication + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? TargetUsingWinAuth { get => this._targetUsingWinAuth; } + + /// Creates an new instance. + public DataMigrationProjectMetadata() + { + + } + } + /// Common metadata for migration projects + public partial interface IDataMigrationProjectMetadata : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of tables selected for migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of tables selected for migration", + SerializedName = @"selectedMigrationTables", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata[] SelectedMigrationTable { get; } + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server name", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Source server port number + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server port number", + SerializedName = @"sourceServerPort", + PossibleTypes = new [] { typeof(string) })] + string SourceServerPort { get; } + /// Source username + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source username", + SerializedName = @"sourceUsername", + PossibleTypes = new [] { typeof(string) })] + string SourceUsername { get; } + /// Target database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target database name", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + string TargetDbName { get; } + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server name", + SerializedName = @"targetServerName", + PossibleTypes = new [] { typeof(string) })] + string TargetServerName { get; } + /// Target username + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target username", + SerializedName = @"targetUsername", + PossibleTypes = new [] { typeof(string) })] + string TargetUsername { get; } + /// Whether target connection is Windows authentication + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether target connection is Windows authentication", + SerializedName = @"targetUsingWinAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetUsingWinAuth { get; } + + } + /// Common metadata for migration projects + internal partial interface IDataMigrationProjectMetadataInternal + + { + /// List of tables selected for migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata[] SelectedMigrationTable { get; set; } + /// Source server name + string SourceServerName { get; set; } + /// Source server port number + string SourceServerPort { get; set; } + /// Source username + string SourceUsername { get; set; } + /// Target database name + string TargetDbName { get; set; } + /// Target server name + string TargetServerName { get; set; } + /// Target username + string TargetUsername { get; set; } + /// Whether target connection is Windows authentication + bool? TargetUsingWinAuth { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.json.cs new file mode 100644 index 000000000000..97bb41faaae9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationProjectMetadata.json.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Common metadata for migration projects + public partial class DataMigrationProjectMetadata + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataMigrationProjectMetadata(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceServerName = If( json?.PropertyT("sourceServerName"), out var __jsonSourceServerName) ? (string)__jsonSourceServerName : (string)SourceServerName;} + {_sourceServerPort = If( json?.PropertyT("sourceServerPort"), out var __jsonSourceServerPort) ? (string)__jsonSourceServerPort : (string)SourceServerPort;} + {_sourceUsername = If( json?.PropertyT("sourceUsername"), out var __jsonSourceUsername) ? (string)__jsonSourceUsername : (string)SourceUsername;} + {_targetServerName = If( json?.PropertyT("targetServerName"), out var __jsonTargetServerName) ? (string)__jsonTargetServerName : (string)TargetServerName;} + {_targetUsername = If( json?.PropertyT("targetUsername"), out var __jsonTargetUsername) ? (string)__jsonTargetUsername : (string)TargetUsername;} + {_targetDbName = If( json?.PropertyT("targetDbName"), out var __jsonTargetDbName) ? (string)__jsonTargetDbName : (string)TargetDbName;} + {_targetUsingWinAuth = If( json?.PropertyT("targetUsingWinAuth"), out var __jsonTargetUsingWinAuth) ? (bool?)__jsonTargetUsingWinAuth : TargetUsingWinAuth;} + {_selectedMigrationTable = If( json?.PropertyT("selectedMigrationTables"), out var __jsonSelectedMigrationTables) ? If( __jsonSelectedMigrationTables as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationTableMetadata.FromJson(__u) )) ))() : null : SelectedMigrationTable;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationProjectMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataMigrationProjectMetadata(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerName.ToString()) : null, "sourceServerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerPort)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerPort.ToString()) : null, "sourceServerPort" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceUsername.ToString()) : null, "sourceUsername" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerName.ToString()) : null, "targetServerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetUsername.ToString()) : null, "targetUsername" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetDbName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDbName.ToString()) : null, "targetDbName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._targetUsingWinAuth ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._targetUsingWinAuth) : null, "targetUsingWinAuth" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._selectedMigrationTable) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedMigrationTable ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedMigrationTables",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.PowerShell.cs new file mode 100644 index 000000000000..3ecfe5043aa3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.PowerShell.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A Database Migration Service resource + [System.ComponentModel.TypeConverter(typeof(DataMigrationServiceTypeConverter))] + public partial class DataMigrationService + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataMigrationService(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState.CreateFrom); + } + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).PublicKey, global::System.Convert.ToString); + } + if (content.Contains("VirtualSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualSubnetId = (string) content.GetValueForProperty("VirtualSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualSubnetId, global::System.Convert.ToString); + } + if (content.Contains("VirtualNicId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualNicId = (string) content.GetValueForProperty("VirtualNicId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualNicId, global::System.Convert.ToString); + } + if (content.Contains("AutoStopDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).AutoStopDelay = (string) content.GetValueForProperty("AutoStopDelay",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).AutoStopDelay, global::System.Convert.ToString); + } + if (content.Contains("DeleteResourcesOnStop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).DeleteResourcesOnStop = (bool?) content.GetValueForProperty("DeleteResourcesOnStop",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).DeleteResourcesOnStop, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("SkuFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuFamily = (string) content.GetValueForProperty("SkuFamily",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuFamily, global::System.Convert.ToString); + } + if (content.Contains("SkuSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuSize = (string) content.GetValueForProperty("SkuSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuSize, global::System.Convert.ToString); + } + if (content.Contains("SkuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuCapacity = (int?) content.GetValueForProperty("SkuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuCapacity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataMigrationService(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState.CreateFrom); + } + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).PublicKey, global::System.Convert.ToString); + } + if (content.Contains("VirtualSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualSubnetId = (string) content.GetValueForProperty("VirtualSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualSubnetId, global::System.Convert.ToString); + } + if (content.Contains("VirtualNicId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualNicId = (string) content.GetValueForProperty("VirtualNicId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).VirtualNicId, global::System.Convert.ToString); + } + if (content.Contains("AutoStopDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).AutoStopDelay = (string) content.GetValueForProperty("AutoStopDelay",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).AutoStopDelay, global::System.Convert.ToString); + } + if (content.Contains("DeleteResourcesOnStop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).DeleteResourcesOnStop = (bool?) content.GetValueForProperty("DeleteResourcesOnStop",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).DeleteResourcesOnStop, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("SkuFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuFamily = (string) content.GetValueForProperty("SkuFamily",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuFamily, global::System.Convert.ToString); + } + if (content.Contains("SkuSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuSize = (string) content.GetValueForProperty("SkuSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuSize, global::System.Convert.ToString); + } + if (content.Contains("SkuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuCapacity = (int?) content.GetValueForProperty("SkuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal)this).SkuCapacity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataMigrationService(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataMigrationService(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A Database Migration Service resource + [System.ComponentModel.TypeConverter(typeof(DataMigrationServiceTypeConverter))] + public partial interface IDataMigrationService + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.TypeConverter.cs new file mode 100644 index 000000000000..ca4c0cb9d8e0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataMigrationServiceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataMigrationService.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataMigrationService.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataMigrationService.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.cs new file mode 100644 index 000000000000..2badea3503d5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.cs @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A Database Migration Service resource + public partial class DataMigrationService : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource(); + + /// The time delay before the service is auto-stopped when idle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AutoStopDelay { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).AutoStopDelay; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).AutoStopDelay = value ?? null; } + + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? DeleteResourcesOnStop { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).DeleteResourcesOnStop; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).DeleteResourcesOnStop = value ?? default(bool); } + + /// Backing field for property. + private string _etag; + + /// HTTP strong entity tag value. Ignored if submitted + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private string _kind; + + /// The resource kind. Only 'vm' (the default) is supported. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Kind { get => this._kind; set => this._kind = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSku()); set { {_sku = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties _property; + + /// Custom service properties + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceProperties()); set => this._property = value; } + + /// The resource's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).ProvisioningState; } + + /// The public key of the service, used to encrypt secrets sent to the service + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string PublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).PublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).PublicKey = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku _sku; + + /// Service SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSku()); set => this._sku = value; } + + /// The capacity of the SKU, if it supports scaling + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SkuCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Capacity = value ?? default(int); } + + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Family; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Family = value ?? null; } + + /// The unique name of the SKU, such as 'P3' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Name = value ?? null; } + + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Size; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Size = value ?? null; } + + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)Sku).Tier = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type; } + + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string VirtualNicId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).VirtualNicId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).VirtualNicId = value ?? null; } + + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string VirtualSubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).VirtualSubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)Property).VirtualSubnetId = value ?? null; } + + /// Creates an new instance. + public DataMigrationService() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// A Database Migration Service resource + public partial interface IDataMigrationService : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource + { + /// The time delay before the service is auto-stopped when idle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time delay before the service is auto-stopped when idle.", + SerializedName = @"autoStopDelay", + PossibleTypes = new [] { typeof(string) })] + string AutoStopDelay { get; set; } + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether service resources should be deleted when stopped. (Turned on by default)", + SerializedName = @"deleteResourcesOnStop", + PossibleTypes = new [] { typeof(bool) })] + bool? DeleteResourcesOnStop { get; set; } + /// HTTP strong entity tag value. Ignored if submitted + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. Ignored if submitted", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// The resource kind. Only 'vm' (the default) is supported. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource kind. Only 'vm' (the default) is supported.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; set; } + /// The resource's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource's provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? ProvisioningState { get; } + /// The public key of the service, used to encrypt secrets sent to the service + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The public key of the service, used to encrypt secrets sent to the service", + SerializedName = @"publicKey", + PossibleTypes = new [] { typeof(string) })] + string PublicKey { get; set; } + /// The capacity of the SKU, if it supports scaling + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity of the SKU, if it supports scaling", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + int? SkuCapacity { get; set; } + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + string SkuFamily { get; set; } + /// The unique name of the SKU, such as 'P3' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique name of the SKU, such as 'P3'", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; set; } + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string SkuSize { get; set; } + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + string SkuTier { get; set; } + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/networkInterfaces resource which the service have", + SerializedName = @"virtualNicId", + PossibleTypes = new [] { typeof(string) })] + string VirtualNicId { get; set; } + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined", + SerializedName = @"virtualSubnetId", + PossibleTypes = new [] { typeof(string) })] + string VirtualSubnetId { get; set; } + + } + /// A Database Migration Service resource + internal partial interface IDataMigrationServiceInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal + { + /// The time delay before the service is auto-stopped when idle. + string AutoStopDelay { get; set; } + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + bool? DeleteResourcesOnStop { get; set; } + /// HTTP strong entity tag value. Ignored if submitted + string Etag { get; set; } + /// The resource kind. Only 'vm' (the default) is supported. + string Kind { get; set; } + /// Custom service properties + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties Property { get; set; } + /// The resource's provisioning state + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? ProvisioningState { get; set; } + /// The public key of the service, used to encrypt secrets sent to the service + string PublicKey { get; set; } + /// Service SKU + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku Sku { get; set; } + /// The capacity of the SKU, if it supports scaling + int? SkuCapacity { get; set; } + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + string SkuFamily { get; set; } + /// The unique name of the SKU, such as 'P3' + string SkuName { get; set; } + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + string SkuSize { get; set; } + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + string SkuTier { get; set; } + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + string VirtualNicId { get; set; } + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + string VirtualSubnetId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.json.cs new file mode 100644 index 000000000000..dd728e6a2296 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationService.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A Database Migration Service resource + public partial class DataMigrationService + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataMigrationService(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceSku.FromJson(__jsonSku) : Sku;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataMigrationService(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.PowerShell.cs new file mode 100644 index 000000000000..be0fdaba02ea --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// OData page of service objects + [System.ComponentModel.TypeConverter(typeof(DataMigrationServiceListTypeConverter))] + public partial class DataMigrationServiceList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataMigrationServiceList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataMigrationServiceList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationServiceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataMigrationServiceList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataMigrationServiceList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OData page of service objects + [System.ComponentModel.TypeConverter(typeof(DataMigrationServiceListTypeConverter))] + public partial interface IDataMigrationServiceList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.TypeConverter.cs new file mode 100644 index 000000000000..384c0e4030f3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataMigrationServiceListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataMigrationServiceList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataMigrationServiceList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataMigrationServiceList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.cs new file mode 100644 index 000000000000..70930acf7451 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of service objects + public partial class DataMigrationServiceList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to load the next page of services + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService[] _value; + + /// List of services + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public DataMigrationServiceList() + { + + } + } + /// OData page of service objects + public partial interface IDataMigrationServiceList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// URL to load the next page of services + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to load the next page of services", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of services + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of services", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService[] Value { get; set; } + + } + /// OData page of service objects + internal partial interface IDataMigrationServiceListInternal + + { + /// URL to load the next page of services + string NextLink { get; set; } + /// List of services + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.json.cs new file mode 100644 index 000000000000..86da49c3142e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of service objects + public partial class DataMigrationServiceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataMigrationServiceList(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataMigrationServiceList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..6c773dd24875 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties of the Database Migration Service instance + [System.ComponentModel.TypeConverter(typeof(DataMigrationServicePropertiesTypeConverter))] + public partial class DataMigrationServiceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataMigrationServiceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState.CreateFrom); + } + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).PublicKey, global::System.Convert.ToString); + } + if (content.Contains("VirtualSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualSubnetId = (string) content.GetValueForProperty("VirtualSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualSubnetId, global::System.Convert.ToString); + } + if (content.Contains("VirtualNicId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualNicId = (string) content.GetValueForProperty("VirtualNicId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualNicId, global::System.Convert.ToString); + } + if (content.Contains("AutoStopDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).AutoStopDelay = (string) content.GetValueForProperty("AutoStopDelay",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).AutoStopDelay, global::System.Convert.ToString); + } + if (content.Contains("DeleteResourcesOnStop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).DeleteResourcesOnStop = (bool?) content.GetValueForProperty("DeleteResourcesOnStop",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).DeleteResourcesOnStop, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataMigrationServiceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState.CreateFrom); + } + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).PublicKey, global::System.Convert.ToString); + } + if (content.Contains("VirtualSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualSubnetId = (string) content.GetValueForProperty("VirtualSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualSubnetId, global::System.Convert.ToString); + } + if (content.Contains("VirtualNicId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualNicId = (string) content.GetValueForProperty("VirtualNicId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).VirtualNicId, global::System.Convert.ToString); + } + if (content.Contains("AutoStopDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).AutoStopDelay = (string) content.GetValueForProperty("AutoStopDelay",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).AutoStopDelay, global::System.Convert.ToString); + } + if (content.Contains("DeleteResourcesOnStop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).DeleteResourcesOnStop = (bool?) content.GetValueForProperty("DeleteResourcesOnStop",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal)this).DeleteResourcesOnStop, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataMigrationServiceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataMigrationServiceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Database Migration Service instance + [System.ComponentModel.TypeConverter(typeof(DataMigrationServicePropertiesTypeConverter))] + public partial interface IDataMigrationServiceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..824e0f5d969d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataMigrationServicePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataMigrationServiceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataMigrationServiceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataMigrationServiceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.cs new file mode 100644 index 000000000000..5a1d3f1b4b08 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties of the Database Migration Service instance + public partial class DataMigrationServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal + { + + /// Backing field for property. + private string _autoStopDelay; + + /// The time delay before the service is auto-stopped when idle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AutoStopDelay { get => this._autoStopDelay; set => this._autoStopDelay = value; } + + /// Backing field for property. + private bool? _deleteResourcesOnStop; + + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? DeleteResourcesOnStop { get => this._deleteResourcesOnStop; set => this._deleteResourcesOnStop = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? _provisioningState; + + /// The resource's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _publicKey; + + /// The public key of the service, used to encrypt secrets sent to the service + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string PublicKey { get => this._publicKey; set => this._publicKey = value; } + + /// Backing field for property. + private string _virtualNicId; + + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string VirtualNicId { get => this._virtualNicId; set => this._virtualNicId = value; } + + /// Backing field for property. + private string _virtualSubnetId; + + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string VirtualSubnetId { get => this._virtualSubnetId; set => this._virtualSubnetId = value; } + + /// Creates an new instance. + public DataMigrationServiceProperties() + { + + } + } + /// Properties of the Database Migration Service instance + public partial interface IDataMigrationServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The time delay before the service is auto-stopped when idle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time delay before the service is auto-stopped when idle.", + SerializedName = @"autoStopDelay", + PossibleTypes = new [] { typeof(string) })] + string AutoStopDelay { get; set; } + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether service resources should be deleted when stopped. (Turned on by default)", + SerializedName = @"deleteResourcesOnStop", + PossibleTypes = new [] { typeof(bool) })] + bool? DeleteResourcesOnStop { get; set; } + /// The resource's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource's provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? ProvisioningState { get; } + /// The public key of the service, used to encrypt secrets sent to the service + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The public key of the service, used to encrypt secrets sent to the service", + SerializedName = @"publicKey", + PossibleTypes = new [] { typeof(string) })] + string PublicKey { get; set; } + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/networkInterfaces resource which the service have", + SerializedName = @"virtualNicId", + PossibleTypes = new [] { typeof(string) })] + string VirtualNicId { get; set; } + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined", + SerializedName = @"virtualSubnetId", + PossibleTypes = new [] { typeof(string) })] + string VirtualSubnetId { get; set; } + + } + /// Properties of the Database Migration Service instance + internal partial interface IDataMigrationServicePropertiesInternal + + { + /// The time delay before the service is auto-stopped when idle. + string AutoStopDelay { get; set; } + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + bool? DeleteResourcesOnStop { get; set; } + /// The resource's provisioning state + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState? ProvisioningState { get; set; } + /// The public key of the service, used to encrypt secrets sent to the service + string PublicKey { get; set; } + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + string VirtualNicId { get; set; } + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + string VirtualSubnetId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.json.cs new file mode 100644 index 000000000000..00b81263bd92 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceProperties.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties of the Database Migration Service instance + public partial class DataMigrationServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataMigrationServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_publicKey = If( json?.PropertyT("publicKey"), out var __jsonPublicKey) ? (string)__jsonPublicKey : (string)PublicKey;} + {_virtualSubnetId = If( json?.PropertyT("virtualSubnetId"), out var __jsonVirtualSubnetId) ? (string)__jsonVirtualSubnetId : (string)VirtualSubnetId;} + {_virtualNicId = If( json?.PropertyT("virtualNicId"), out var __jsonVirtualNicId) ? (string)__jsonVirtualNicId : (string)VirtualNicId;} + {_autoStopDelay = If( json?.PropertyT("autoStopDelay"), out var __jsonAutoStopDelay) ? (string)__jsonAutoStopDelay : (string)AutoStopDelay;} + {_deleteResourcesOnStop = If( json?.PropertyT("deleteResourcesOnStop"), out var __jsonDeleteResourcesOnStop) ? (bool?)__jsonDeleteResourcesOnStop : DeleteResourcesOnStop;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataMigrationServiceProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AddIf( null != (((object)this._publicKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._publicKey.ToString()) : null, "publicKey" ,container.Add ); + AddIf( null != (((object)this._virtualSubnetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._virtualSubnetId.ToString()) : null, "virtualSubnetId" ,container.Add ); + AddIf( null != (((object)this._virtualNicId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._virtualNicId.ToString()) : null, "virtualNicId" ,container.Add ); + AddIf( null != (((object)this._autoStopDelay)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._autoStopDelay.ToString()) : null, "autoStopDelay" ,container.Add ); + AddIf( null != this._deleteResourcesOnStop ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._deleteResourcesOnStop) : null, "deleteResourcesOnStop" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.PowerShell.cs new file mode 100644 index 000000000000..4395c84a55ad --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Service health status + [System.ComponentModel.TypeConverter(typeof(DataMigrationServiceStatusResponseTypeConverter))] + public partial class DataMigrationServiceStatusResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataMigrationServiceStatusResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AgentVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentVersion = (string) content.GetValueForProperty("AgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentVersion, global::System.Convert.ToString); + } + if (content.Contains("AgentConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny) content.GetValueForProperty("AgentConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("SupportedTaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).SupportedTaskType = (string[]) content.GetValueForProperty("SupportedTaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).SupportedTaskType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataMigrationServiceStatusResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AgentVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentVersion = (string) content.GetValueForProperty("AgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentVersion, global::System.Convert.ToString); + } + if (content.Contains("AgentConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny) content.GetValueForProperty("AgentConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).AgentConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("SupportedTaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).SupportedTaskType = (string[]) content.GetValueForProperty("SupportedTaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal)this).SupportedTaskType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataMigrationServiceStatusResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataMigrationServiceStatusResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Service health status + [System.ComponentModel.TypeConverter(typeof(DataMigrationServiceStatusResponseTypeConverter))] + public partial interface IDataMigrationServiceStatusResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.TypeConverter.cs new file mode 100644 index 000000000000..78c33bf51719 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataMigrationServiceStatusResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataMigrationServiceStatusResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataMigrationServiceStatusResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataMigrationServiceStatusResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.cs new file mode 100644 index 000000000000..c350c9d79c72 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Service health status + public partial class DataMigrationServiceStatusResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponseInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny _agentConfiguration; + + /// Agent Configuration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny AgentConfiguration { get => (this._agentConfiguration = this._agentConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Any()); set => this._agentConfiguration = value; } + + /// Backing field for property. + private string _agentVersion; + + /// The DMS instance agent version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AgentVersion { get => this._agentVersion; set => this._agentVersion = value; } + + /// Backing field for property. + private string _status; + + /// + /// The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', + /// 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed' + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string[] _supportedTaskType; + + /// The list of supported task types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SupportedTaskType { get => this._supportedTaskType; set => this._supportedTaskType = value; } + + /// Backing field for property. + private string _vMSize; + + /// The services virtual machine size, such as 'Standard_D2_v2' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string VMSize { get => this._vMSize; set => this._vMSize = value; } + + /// Creates an new instance. + public DataMigrationServiceStatusResponse() + { + + } + } + /// Service health status + public partial interface IDataMigrationServiceStatusResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Agent Configuration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Agent Configuration", + SerializedName = @"agentConfiguration", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny AgentConfiguration { get; set; } + /// The DMS instance agent version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The DMS instance agent version", + SerializedName = @"agentVersion", + PossibleTypes = new [] { typeof(string) })] + string AgentVersion { get; set; } + /// + /// The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', + /// 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed' + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// The list of supported task types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of supported task types", + SerializedName = @"supportedTaskTypes", + PossibleTypes = new [] { typeof(string) })] + string[] SupportedTaskType { get; set; } + /// The services virtual machine size, such as 'Standard_D2_v2' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The services virtual machine size, such as 'Standard_D2_v2'", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; set; } + + } + /// Service health status + internal partial interface IDataMigrationServiceStatusResponseInternal + + { + /// Agent Configuration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny AgentConfiguration { get; set; } + /// The DMS instance agent version + string AgentVersion { get; set; } + /// + /// The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', + /// 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed' + /// + string Status { get; set; } + /// The list of supported task types + string[] SupportedTaskType { get; set; } + /// The services virtual machine size, such as 'Standard_D2_v2' + string VMSize { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.json.cs new file mode 100644 index 000000000000..20f4c78a0326 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DataMigrationServiceStatusResponse.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Service health status + public partial class DataMigrationServiceStatusResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataMigrationServiceStatusResponse(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_agentVersion = If( json?.PropertyT("agentVersion"), out var __jsonAgentVersion) ? (string)__jsonAgentVersion : (string)AgentVersion;} + {_agentConfiguration = If( json?.PropertyT("agentConfiguration"), out var __jsonAgentConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Any.FromJson(__jsonAgentConfiguration) : AgentConfiguration;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_vMSize = If( json?.PropertyT("vmSize"), out var __jsonVMSize) ? (string)__jsonVMSize : (string)VMSize;} + {_supportedTaskType = If( json?.PropertyT("supportedTaskTypes"), out var __jsonSupportedTaskTypes) ? If( __jsonSupportedTaskTypes as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SupportedTaskType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataMigrationServiceStatusResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._agentVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._agentVersion.ToString()) : null, "agentVersion" ,container.Add ); + AddIf( null != this._agentConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._agentConfiguration.ToJson(null,serializationMode) : null, "agentConfiguration" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._vMSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._vMSize.ToString()) : null, "vmSize" ,container.Add ); + if (null != this._supportedTaskType) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._supportedTaskType ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("supportedTaskTypes",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.PowerShell.cs new file mode 100644 index 000000000000..fcbd3da19eae --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.PowerShell.cs @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information about a single database + [System.ComponentModel.TypeConverter(typeof(DatabaseTypeConverter))] + public partial class Database + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Database(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("CompatibilityLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).CompatibilityLevel = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel?) content.GetValueForProperty("CompatibilityLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).CompatibilityLevel, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel.CreateFrom); + } + if (content.Contains("Collation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Collation = (string) content.GetValueForProperty("Collation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Collation, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("InstallId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).InstallId = (string) content.GetValueForProperty("InstallId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).InstallId, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerEdition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerEdition = (string) content.GetValueForProperty("ServerEdition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerEdition, global::System.Convert.ToString); + } + if (content.Contains("ServerLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerLevel = (string) content.GetValueForProperty("ServerLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerLevel, global::System.Convert.ToString); + } + if (content.Contains("ServerDefaultDataPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultDataPath = (string) content.GetValueForProperty("ServerDefaultDataPath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultDataPath, global::System.Convert.ToString); + } + if (content.Contains("ServerDefaultLogPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultLogPath = (string) content.GetValueForProperty("ServerDefaultLogPath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultLogPath, global::System.Convert.ToString); + } + if (content.Contains("ServerDefaultBackupPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultBackupPath = (string) content.GetValueForProperty("ServerDefaultBackupPath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultBackupPath, global::System.Convert.ToString); + } + if (content.Contains("ServerCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerCoreCount = (int?) content.GetValueForProperty("ServerCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerCoreCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ServerVisibleOnlineCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVisibleOnlineCoreCount = (int?) content.GetValueForProperty("ServerVisibleOnlineCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVisibleOnlineCoreCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState.CreateFrom); + } + if (content.Contains("ServerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerId = (string) content.GetValueForProperty("ServerId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Database(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("CompatibilityLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).CompatibilityLevel = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel?) content.GetValueForProperty("CompatibilityLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).CompatibilityLevel, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel.CreateFrom); + } + if (content.Contains("Collation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Collation = (string) content.GetValueForProperty("Collation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Collation, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("InstallId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).InstallId = (string) content.GetValueForProperty("InstallId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).InstallId, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerEdition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerEdition = (string) content.GetValueForProperty("ServerEdition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerEdition, global::System.Convert.ToString); + } + if (content.Contains("ServerLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerLevel = (string) content.GetValueForProperty("ServerLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerLevel, global::System.Convert.ToString); + } + if (content.Contains("ServerDefaultDataPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultDataPath = (string) content.GetValueForProperty("ServerDefaultDataPath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultDataPath, global::System.Convert.ToString); + } + if (content.Contains("ServerDefaultLogPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultLogPath = (string) content.GetValueForProperty("ServerDefaultLogPath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultLogPath, global::System.Convert.ToString); + } + if (content.Contains("ServerDefaultBackupPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultBackupPath = (string) content.GetValueForProperty("ServerDefaultBackupPath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerDefaultBackupPath, global::System.Convert.ToString); + } + if (content.Contains("ServerCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerCoreCount = (int?) content.GetValueForProperty("ServerCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerCoreCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ServerVisibleOnlineCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVisibleOnlineCoreCount = (int?) content.GetValueForProperty("ServerVisibleOnlineCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerVisibleOnlineCoreCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState.CreateFrom); + } + if (content.Contains("ServerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerId = (string) content.GetValueForProperty("ServerId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal)this).ServerId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Database(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Database(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about a single database + [System.ComponentModel.TypeConverter(typeof(DatabaseTypeConverter))] + public partial interface IDatabase + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.TypeConverter.cs new file mode 100644 index 000000000000..8548804de17b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Database.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Database.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Database.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.cs new file mode 100644 index 000000000000..80129462cd36 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.cs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about a single database + public partial class Database : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInternal + { + + /// Backing field for property. + private string _collation; + + /// Collation name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Collation { get => this._collation; set => this._collation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? _compatibilityLevel; + + /// SQL Server compatibility level of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? CompatibilityLevel { get => this._compatibilityLevel; set => this._compatibilityLevel = value; } + + /// Backing field for property. + private string _fqdn; + + /// Fully qualified name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Fqdn { get => this._fqdn; set => this._fqdn = value; } + + /// Backing field for property. + private string _id; + + /// Unique identifier for the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _installId; + + /// Install id of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string InstallId { get => this._installId; set => this._installId = value; } + + /// Backing field for property. + private string _name; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private int? _serverCoreCount; + + /// Number of cores on the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? ServerCoreCount { get => this._serverCoreCount; set => this._serverCoreCount = value; } + + /// Backing field for property. + private string _serverDefaultBackupPath; + + /// Default path of the backup folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerDefaultBackupPath { get => this._serverDefaultBackupPath; set => this._serverDefaultBackupPath = value; } + + /// Backing field for property. + private string _serverDefaultDataPath; + + /// Default path of the data files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerDefaultDataPath { get => this._serverDefaultDataPath; set => this._serverDefaultDataPath = value; } + + /// Backing field for property. + private string _serverDefaultLogPath; + + /// Default path of the log files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerDefaultLogPath { get => this._serverDefaultLogPath; set => this._serverDefaultLogPath = value; } + + /// Backing field for property. + private string _serverEdition; + + /// Edition of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerEdition { get => this._serverEdition; set => this._serverEdition = value; } + + /// Backing field for property. + private string _serverId; + + /// The unique Server Id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerId { get => this._serverId; set => this._serverId = value; } + + /// Backing field for property. + private string _serverLevel; + + /// Product level of the server (RTM, SP, CTP). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerLevel { get => this._serverLevel; set => this._serverLevel = value; } + + /// Backing field for property. + private string _serverName; + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Backing field for property. + private string _serverVersion; + + /// Version of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; set => this._serverVersion = value; } + + /// Backing field for property. + private int? _serverVisibleOnlineCoreCount; + + /// Number of cores on the server that have VISIBLE ONLINE status + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? ServerVisibleOnlineCoreCount { get => this._serverVisibleOnlineCoreCount; set => this._serverVisibleOnlineCoreCount = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? _state; + + /// State of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public Database() + { + + } + } + /// Information about a single database + public partial interface IDatabase : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Collation name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collation name of the database", + SerializedName = @"collation", + PossibleTypes = new [] { typeof(string) })] + string Collation { get; set; } + /// SQL Server compatibility level of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SQL Server compatibility level of database", + SerializedName = @"compatibilityLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? CompatibilityLevel { get; set; } + /// Fully qualified name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified name", + SerializedName = @"fqdn", + PossibleTypes = new [] { typeof(string) })] + string Fqdn { get; set; } + /// Unique identifier for the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique identifier for the database", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Install id of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Install id of the database", + SerializedName = @"installId", + PossibleTypes = new [] { typeof(string) })] + string InstallId { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Number of cores on the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of cores on the server", + SerializedName = @"serverCoreCount", + PossibleTypes = new [] { typeof(int) })] + int? ServerCoreCount { get; set; } + /// Default path of the backup folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default path of the backup folder", + SerializedName = @"serverDefaultBackupPath", + PossibleTypes = new [] { typeof(string) })] + string ServerDefaultBackupPath { get; set; } + /// Default path of the data files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default path of the data files", + SerializedName = @"serverDefaultDataPath", + PossibleTypes = new [] { typeof(string) })] + string ServerDefaultDataPath { get; set; } + /// Default path of the log files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default path of the log files", + SerializedName = @"serverDefaultLogPath", + PossibleTypes = new [] { typeof(string) })] + string ServerDefaultLogPath { get; set; } + /// Edition of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Edition of the server", + SerializedName = @"serverEdition", + PossibleTypes = new [] { typeof(string) })] + string ServerEdition { get; set; } + /// The unique Server Id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique Server Id", + SerializedName = @"serverId", + PossibleTypes = new [] { typeof(string) })] + string ServerId { get; set; } + /// Product level of the server (RTM, SP, CTP). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product level of the server (RTM, SP, CTP).", + SerializedName = @"serverLevel", + PossibleTypes = new [] { typeof(string) })] + string ServerLevel { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + /// Version of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the server", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; set; } + /// Number of cores on the server that have VISIBLE ONLINE status + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of cores on the server that have VISIBLE ONLINE status", + SerializedName = @"serverVisibleOnlineCoreCount", + PossibleTypes = new [] { typeof(int) })] + int? ServerVisibleOnlineCoreCount { get; set; } + /// State of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"State of the database", + SerializedName = @"databaseState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? State { get; set; } + + } + /// Information about a single database + internal partial interface IDatabaseInternal + + { + /// Collation name of the database + string Collation { get; set; } + /// SQL Server compatibility level of database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel? CompatibilityLevel { get; set; } + /// Fully qualified name + string Fqdn { get; set; } + /// Unique identifier for the database + string Id { get; set; } + /// Install id of the database + string InstallId { get; set; } + /// Name of the database + string Name { get; set; } + /// Number of cores on the server + int? ServerCoreCount { get; set; } + /// Default path of the backup folder + string ServerDefaultBackupPath { get; set; } + /// Default path of the data files + string ServerDefaultDataPath { get; set; } + /// Default path of the log files + string ServerDefaultLogPath { get; set; } + /// Edition of the server + string ServerEdition { get; set; } + /// The unique Server Id + string ServerId { get; set; } + /// Product level of the server (RTM, SP, CTP). + string ServerLevel { get; set; } + /// Name of the server + string ServerName { get; set; } + /// Version of the server + string ServerVersion { get; set; } + /// Number of cores on the server that have VISIBLE ONLINE status + int? ServerVisibleOnlineCoreCount { get; set; } + /// State of the database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.json.cs new file mode 100644 index 000000000000..996a7efd7e9a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Database.json.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about a single database + public partial class Database + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal Database(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_compatibilityLevel = If( json?.PropertyT("compatibilityLevel"), out var __jsonCompatibilityLevel) ? (string)__jsonCompatibilityLevel : (string)CompatibilityLevel;} + {_collation = If( json?.PropertyT("collation"), out var __jsonCollation) ? (string)__jsonCollation : (string)Collation;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_fqdn = If( json?.PropertyT("fqdn"), out var __jsonFqdn) ? (string)__jsonFqdn : (string)Fqdn;} + {_installId = If( json?.PropertyT("installId"), out var __jsonInstallId) ? (string)__jsonInstallId : (string)InstallId;} + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + {_serverEdition = If( json?.PropertyT("serverEdition"), out var __jsonServerEdition) ? (string)__jsonServerEdition : (string)ServerEdition;} + {_serverLevel = If( json?.PropertyT("serverLevel"), out var __jsonServerLevel) ? (string)__jsonServerLevel : (string)ServerLevel;} + {_serverDefaultDataPath = If( json?.PropertyT("serverDefaultDataPath"), out var __jsonServerDefaultDataPath) ? (string)__jsonServerDefaultDataPath : (string)ServerDefaultDataPath;} + {_serverDefaultLogPath = If( json?.PropertyT("serverDefaultLogPath"), out var __jsonServerDefaultLogPath) ? (string)__jsonServerDefaultLogPath : (string)ServerDefaultLogPath;} + {_serverDefaultBackupPath = If( json?.PropertyT("serverDefaultBackupPath"), out var __jsonServerDefaultBackupPath) ? (string)__jsonServerDefaultBackupPath : (string)ServerDefaultBackupPath;} + {_serverCoreCount = If( json?.PropertyT("serverCoreCount"), out var __jsonServerCoreCount) ? (int?)__jsonServerCoreCount : ServerCoreCount;} + {_serverVisibleOnlineCoreCount = If( json?.PropertyT("serverVisibleOnlineCoreCount"), out var __jsonServerVisibleOnlineCoreCount) ? (int?)__jsonServerVisibleOnlineCoreCount : ServerVisibleOnlineCoreCount;} + {_state = If( json?.PropertyT("databaseState"), out var __jsonDatabaseState) ? (string)__jsonDatabaseState : (string)State;} + {_serverId = If( json?.PropertyT("serverId"), out var __jsonServerId) ? (string)__jsonServerId : (string)ServerId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabase FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new Database(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._compatibilityLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._compatibilityLevel.ToString()) : null, "compatibilityLevel" ,container.Add ); + AddIf( null != (((object)this._collation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._collation.ToString()) : null, "collation" ,container.Add ); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != (((object)this._fqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fqdn.ToString()) : null, "fqdn" ,container.Add ); + AddIf( null != (((object)this._installId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._installId.ToString()) : null, "installId" ,container.Add ); + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + AddIf( null != (((object)this._serverEdition)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverEdition.ToString()) : null, "serverEdition" ,container.Add ); + AddIf( null != (((object)this._serverLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverLevel.ToString()) : null, "serverLevel" ,container.Add ); + AddIf( null != (((object)this._serverDefaultDataPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverDefaultDataPath.ToString()) : null, "serverDefaultDataPath" ,container.Add ); + AddIf( null != (((object)this._serverDefaultLogPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverDefaultLogPath.ToString()) : null, "serverDefaultLogPath" ,container.Add ); + AddIf( null != (((object)this._serverDefaultBackupPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverDefaultBackupPath.ToString()) : null, "serverDefaultBackupPath" ,container.Add ); + AddIf( null != this._serverCoreCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._serverCoreCount) : null, "serverCoreCount" ,container.Add ); + AddIf( null != this._serverVisibleOnlineCoreCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._serverVisibleOnlineCoreCount) : null, "serverVisibleOnlineCoreCount" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "databaseState" ,container.Add ); + AddIf( null != (((object)this._serverId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverId.ToString()) : null, "serverId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.PowerShell.cs new file mode 100644 index 000000000000..a0d1cd58ef92 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information about backup files when existing backup mode is used. + [System.ComponentModel.TypeConverter(typeof(DatabaseBackupInfoTypeConverter))] + public partial class DatabaseBackupInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseBackupInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("BackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("BackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFile = (string[]) content.GetValueForProperty("BackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFile, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Position")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).Position = (int?) content.GetValueForProperty("Position",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).Position, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IsDamaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsDamaged = (bool?) content.GetValueForProperty("IsDamaged",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsDamaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsCompressed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsCompressed = (bool?) content.GetValueForProperty("IsCompressed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsCompressed, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).FamilyCount = (int?) content.GetValueForProperty("FamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).FamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("BackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseBackupInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("BackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("BackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFile = (string[]) content.GetValueForProperty("BackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFile, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Position")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).Position = (int?) content.GetValueForProperty("Position",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).Position, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IsDamaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsDamaged = (bool?) content.GetValueForProperty("IsDamaged",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsDamaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsCompressed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsCompressed = (bool?) content.GetValueForProperty("IsCompressed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).IsCompressed, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).FamilyCount = (int?) content.GetValueForProperty("FamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).FamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("BackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)this).BackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseBackupInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseBackupInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about backup files when existing backup mode is used. + [System.ComponentModel.TypeConverter(typeof(DatabaseBackupInfoTypeConverter))] + public partial interface IDatabaseBackupInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.TypeConverter.cs new file mode 100644 index 000000000000..d8d074d1e9f1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseBackupInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseBackupInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseBackupInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseBackupInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.cs new file mode 100644 index 000000000000..496fda040d24 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about backup files when existing backup mode is used. + public partial class DatabaseBackupInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal + { + + /// Backing field for property. + private string[] _backupFile; + + /// The list of backup files for the current database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] BackupFile { get => this._backupFile; } + + /// Backing field for property. + private global::System.DateTime? _backupFinishDate; + + /// Date and time when the backup operation finished. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? BackupFinishDate { get => this._backupFinishDate; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? _backupType; + + /// Backup Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? BackupType { get => this._backupType; } + + /// Backing field for property. + private string _databaseName; + + /// Database name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private int? _familyCount; + + /// Number of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? FamilyCount { get => this._familyCount; } + + /// Backing field for property. + private bool? _isCompressed; + + /// Whether the backup set is compressed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsCompressed { get => this._isCompressed; } + + /// Backing field for property. + private bool? _isDamaged; + + /// + /// Database was damaged when backed up, but the backup operation was requested to continue despite errors. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsDamaged { get => this._isDamaged; } + + /// Internal Acessors for BackupFile + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.BackupFile { get => this._backupFile; set { {_backupFile = value;} } } + + /// Internal Acessors for BackupFinishDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.BackupFinishDate { get => this._backupFinishDate; set { {_backupFinishDate = value;} } } + + /// Internal Acessors for BackupType + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.BackupType { get => this._backupType; set { {_backupType = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for FamilyCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.FamilyCount { get => this._familyCount; set { {_familyCount = value;} } } + + /// Internal Acessors for IsCompressed + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.IsCompressed { get => this._isCompressed; set { {_isCompressed = value;} } } + + /// Internal Acessors for IsDamaged + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.IsDamaged { get => this._isDamaged; set { {_isDamaged = value;} } } + + /// Internal Acessors for Position + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal.Position { get => this._position; set { {_position = value;} } } + + /// Backing field for property. + private int? _position; + + /// Position of current database backup in the file. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Position { get => this._position; } + + /// Creates an new instance. + public DatabaseBackupInfo() + { + + } + } + /// Information about backup files when existing backup mode is used. + public partial interface IDatabaseBackupInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The list of backup files for the current database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of backup files for the current database.", + SerializedName = @"backupFiles", + PossibleTypes = new [] { typeof(string) })] + string[] BackupFile { get; } + /// Date and time when the backup operation finished. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date and time when the backup operation finished.", + SerializedName = @"backupFinishDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BackupFinishDate { get; } + /// Backup Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup Type.", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? BackupType { get; } + /// Database name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database name.", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Number of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of files in the backup set.", + SerializedName = @"familyCount", + PossibleTypes = new [] { typeof(int) })] + int? FamilyCount { get; } + /// Whether the backup set is compressed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the backup set is compressed", + SerializedName = @"isCompressed", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCompressed { get; } + /// + /// Database was damaged when backed up, but the backup operation was requested to continue despite errors. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database was damaged when backed up, but the backup operation was requested to continue despite errors.", + SerializedName = @"isDamaged", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDamaged { get; } + /// Position of current database backup in the file. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Position of current database backup in the file.", + SerializedName = @"position", + PossibleTypes = new [] { typeof(int) })] + int? Position { get; } + + } + /// Information about backup files when existing backup mode is used. + internal partial interface IDatabaseBackupInfoInternal + + { + /// The list of backup files for the current database. + string[] BackupFile { get; set; } + /// Date and time when the backup operation finished. + global::System.DateTime? BackupFinishDate { get; set; } + /// Backup Type. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? BackupType { get; set; } + /// Database name. + string DatabaseName { get; set; } + /// Number of files in the backup set. + int? FamilyCount { get; set; } + /// Whether the backup set is compressed + bool? IsCompressed { get; set; } + /// + /// Database was damaged when backed up, but the backup operation was requested to continue despite errors. + /// + bool? IsDamaged { get; set; } + /// Position of current database backup in the file. + int? Position { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.json.cs new file mode 100644 index 000000000000..835987e191f7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseBackupInfo.json.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about backup files when existing backup mode is used. + public partial class DatabaseBackupInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseBackupInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_backupType = If( json?.PropertyT("backupType"), out var __jsonBackupType) ? (string)__jsonBackupType : (string)BackupType;} + {_backupFile = If( json?.PropertyT("backupFiles"), out var __jsonBackupFiles) ? If( __jsonBackupFiles as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : BackupFile;} + {_position = If( json?.PropertyT("position"), out var __jsonPosition) ? (int?)__jsonPosition : Position;} + {_isDamaged = If( json?.PropertyT("isDamaged"), out var __jsonIsDamaged) ? (bool?)__jsonIsDamaged : IsDamaged;} + {_isCompressed = If( json?.PropertyT("isCompressed"), out var __jsonIsCompressed) ? (bool?)__jsonIsCompressed : IsCompressed;} + {_familyCount = If( json?.PropertyT("familyCount"), out var __jsonFamilyCount) ? (int?)__jsonFamilyCount : FamilyCount;} + {_backupFinishDate = If( json?.PropertyT("backupFinishDate"), out var __jsonBackupFinishDate) ? global::System.DateTime.TryParse((string)__jsonBackupFinishDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBackupFinishDateValue) ? __jsonBackupFinishDateValue : BackupFinishDate : BackupFinishDate;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseBackupInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._backupType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupType.ToString()) : null, "backupType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._backupFile) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._backupFile ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("backupFiles",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._position ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._position) : null, "position" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isDamaged ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isDamaged) : null, "isDamaged" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isCompressed ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isCompressed) : null, "isCompressed" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._familyCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._familyCount) : null, "familyCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._backupFinishDate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupFinishDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupFinishDate" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.PowerShell.cs new file mode 100644 index 000000000000..afe3801e4c44 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database file specific information + [System.ComponentModel.TypeConverter(typeof(DatabaseFileInfoTypeConverter))] + public partial class DatabaseFileInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseFileInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("LogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).LogicalName = (string) content.GetValueForProperty("LogicalName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).LogicalName, global::System.Convert.ToString); + } + if (content.Contains("PhysicalFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).PhysicalFullName = (string) content.GetValueForProperty("PhysicalFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).PhysicalFullName, global::System.Convert.ToString); + } + if (content.Contains("RestoreFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).RestoreFullName = (string) content.GetValueForProperty("RestoreFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).RestoreFullName, global::System.Convert.ToString); + } + if (content.Contains("FileType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).FileType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType?) content.GetValueForProperty("FileType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).FileType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType.CreateFrom); + } + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseFileInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("LogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).LogicalName = (string) content.GetValueForProperty("LogicalName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).LogicalName, global::System.Convert.ToString); + } + if (content.Contains("PhysicalFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).PhysicalFullName = (string) content.GetValueForProperty("PhysicalFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).PhysicalFullName, global::System.Convert.ToString); + } + if (content.Contains("RestoreFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).RestoreFullName = (string) content.GetValueForProperty("RestoreFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).RestoreFullName, global::System.Convert.ToString); + } + if (content.Contains("FileType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).FileType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType?) content.GetValueForProperty("FileType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).FileType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType.CreateFrom); + } + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseFileInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseFileInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database file specific information + [System.ComponentModel.TypeConverter(typeof(DatabaseFileInfoTypeConverter))] + public partial interface IDatabaseFileInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.TypeConverter.cs new file mode 100644 index 000000000000..5a2896978a4a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseFileInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseFileInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseFileInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseFileInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.cs new file mode 100644 index 000000000000..f4d2cbac7444 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database file specific information + public partial class DatabaseFileInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfoInternal + { + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? _fileType; + + /// Database file type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? FileType { get => this._fileType; set => this._fileType = value; } + + /// Backing field for property. + private string _id; + + /// Unique identifier for database file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _logicalName; + + /// Logical name of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LogicalName { get => this._logicalName; set => this._logicalName = value; } + + /// Backing field for property. + private string _physicalFullName; + + /// Operating-system full path of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string PhysicalFullName { get => this._physicalFullName; set => this._physicalFullName = value; } + + /// Backing field for property. + private string _restoreFullName; + + /// Suggested full path of the file for restoring + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string RestoreFullName { get => this._restoreFullName; set => this._restoreFullName = value; } + + /// Backing field for property. + private double? _sizeMb; + + /// Size of the file in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? SizeMb { get => this._sizeMb; set => this._sizeMb = value; } + + /// Creates an new instance. + public DatabaseFileInfo() + { + + } + } + /// Database file specific information + public partial interface IDatabaseFileInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + /// Database file type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database file type", + SerializedName = @"fileType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? FileType { get; set; } + /// Unique identifier for database file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique identifier for database file", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Logical name of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logical name of the file", + SerializedName = @"logicalName", + PossibleTypes = new [] { typeof(string) })] + string LogicalName { get; set; } + /// Operating-system full path of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operating-system full path of the file", + SerializedName = @"physicalFullName", + PossibleTypes = new [] { typeof(string) })] + string PhysicalFullName { get; set; } + /// Suggested full path of the file for restoring + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Suggested full path of the file for restoring", + SerializedName = @"restoreFullName", + PossibleTypes = new [] { typeof(string) })] + string RestoreFullName { get; set; } + /// Size of the file in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Size of the file in megabytes", + SerializedName = @"sizeMB", + PossibleTypes = new [] { typeof(double) })] + double? SizeMb { get; set; } + + } + /// Database file specific information + internal partial interface IDatabaseFileInfoInternal + + { + /// Name of the database + string DatabaseName { get; set; } + /// Database file type + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? FileType { get; set; } + /// Unique identifier for database file + string Id { get; set; } + /// Logical name of the file + string LogicalName { get; set; } + /// Operating-system full path of the file + string PhysicalFullName { get; set; } + /// Suggested full path of the file for restoring + string RestoreFullName { get; set; } + /// Size of the file in megabytes + double? SizeMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.json.cs new file mode 100644 index 000000000000..0c9c29c33b70 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database file specific information + public partial class DatabaseFileInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseFileInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_logicalName = If( json?.PropertyT("logicalName"), out var __jsonLogicalName) ? (string)__jsonLogicalName : (string)LogicalName;} + {_physicalFullName = If( json?.PropertyT("physicalFullName"), out var __jsonPhysicalFullName) ? (string)__jsonPhysicalFullName : (string)PhysicalFullName;} + {_restoreFullName = If( json?.PropertyT("restoreFullName"), out var __jsonRestoreFullName) ? (string)__jsonRestoreFullName : (string)RestoreFullName;} + {_fileType = If( json?.PropertyT("fileType"), out var __jsonFileType) ? (string)__jsonFileType : (string)FileType;} + {_sizeMb = If( json?.PropertyT("sizeMB"), out var __jsonSizeMb) ? (double?)__jsonSizeMb : SizeMb;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseFileInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._logicalName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._logicalName.ToString()) : null, "logicalName" ,container.Add ); + AddIf( null != (((object)this._physicalFullName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._physicalFullName.ToString()) : null, "physicalFullName" ,container.Add ); + AddIf( null != (((object)this._restoreFullName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._restoreFullName.ToString()) : null, "restoreFullName" ,container.Add ); + AddIf( null != (((object)this._fileType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileType.ToString()) : null, "fileType" ,container.Add ); + AddIf( null != this._sizeMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._sizeMb) : null, "sizeMB" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.PowerShell.cs new file mode 100644 index 000000000000..73970b93799c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database file specific information for input + [System.ComponentModel.TypeConverter(typeof(DatabaseFileInputTypeConverter))] + public partial class DatabaseFileInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseFileInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("LogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).LogicalName = (string) content.GetValueForProperty("LogicalName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).LogicalName, global::System.Convert.ToString); + } + if (content.Contains("PhysicalFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).PhysicalFullName = (string) content.GetValueForProperty("PhysicalFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).PhysicalFullName, global::System.Convert.ToString); + } + if (content.Contains("RestoreFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).RestoreFullName = (string) content.GetValueForProperty("RestoreFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).RestoreFullName, global::System.Convert.ToString); + } + if (content.Contains("FileType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).FileType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType?) content.GetValueForProperty("FileType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).FileType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseFileInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("LogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).LogicalName = (string) content.GetValueForProperty("LogicalName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).LogicalName, global::System.Convert.ToString); + } + if (content.Contains("PhysicalFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).PhysicalFullName = (string) content.GetValueForProperty("PhysicalFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).PhysicalFullName, global::System.Convert.ToString); + } + if (content.Contains("RestoreFullName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).RestoreFullName = (string) content.GetValueForProperty("RestoreFullName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).RestoreFullName, global::System.Convert.ToString); + } + if (content.Contains("FileType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).FileType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType?) content.GetValueForProperty("FileType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal)this).FileType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseFileInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseFileInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database file specific information for input + [System.ComponentModel.TypeConverter(typeof(DatabaseFileInputTypeConverter))] + public partial interface IDatabaseFileInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.TypeConverter.cs new file mode 100644 index 000000000000..af356b3c2e5c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseFileInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseFileInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseFileInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseFileInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.cs new file mode 100644 index 000000000000..c63d111a14ff --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database file specific information for input + public partial class DatabaseFileInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? _fileType; + + /// Database file type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? FileType { get => this._fileType; set => this._fileType = value; } + + /// Backing field for property. + private string _id; + + /// Unique identifier for database file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _logicalName; + + /// Logical name of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LogicalName { get => this._logicalName; set => this._logicalName = value; } + + /// Backing field for property. + private string _physicalFullName; + + /// Operating-system full path of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string PhysicalFullName { get => this._physicalFullName; set => this._physicalFullName = value; } + + /// Backing field for property. + private string _restoreFullName; + + /// Suggested full path of the file for restoring + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string RestoreFullName { get => this._restoreFullName; set => this._restoreFullName = value; } + + /// Creates an new instance. + public DatabaseFileInput() + { + + } + } + /// Database file specific information for input + public partial interface IDatabaseFileInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Database file type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database file type", + SerializedName = @"fileType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? FileType { get; set; } + /// Unique identifier for database file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique identifier for database file", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Logical name of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logical name of the file", + SerializedName = @"logicalName", + PossibleTypes = new [] { typeof(string) })] + string LogicalName { get; set; } + /// Operating-system full path of the file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operating-system full path of the file", + SerializedName = @"physicalFullName", + PossibleTypes = new [] { typeof(string) })] + string PhysicalFullName { get; set; } + /// Suggested full path of the file for restoring + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Suggested full path of the file for restoring", + SerializedName = @"restoreFullName", + PossibleTypes = new [] { typeof(string) })] + string RestoreFullName { get; set; } + + } + /// Database file specific information for input + internal partial interface IDatabaseFileInputInternal + + { + /// Database file type + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType? FileType { get; set; } + /// Unique identifier for database file + string Id { get; set; } + /// Logical name of the file + string LogicalName { get; set; } + /// Operating-system full path of the file + string PhysicalFullName { get; set; } + /// Suggested full path of the file for restoring + string RestoreFullName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.json.cs new file mode 100644 index 000000000000..b137c6f5f0ba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseFileInput.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database file specific information for input + public partial class DatabaseFileInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseFileInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_logicalName = If( json?.PropertyT("logicalName"), out var __jsonLogicalName) ? (string)__jsonLogicalName : (string)LogicalName;} + {_physicalFullName = If( json?.PropertyT("physicalFullName"), out var __jsonPhysicalFullName) ? (string)__jsonPhysicalFullName : (string)PhysicalFullName;} + {_restoreFullName = If( json?.PropertyT("restoreFullName"), out var __jsonRestoreFullName) ? (string)__jsonRestoreFullName : (string)RestoreFullName;} + {_fileType = If( json?.PropertyT("fileType"), out var __jsonFileType) ? (string)__jsonFileType : (string)FileType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseFileInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._logicalName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._logicalName.ToString()) : null, "logicalName" ,container.Add ); + AddIf( null != (((object)this._physicalFullName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._physicalFullName.ToString()) : null, "physicalFullName" ,container.Add ); + AddIf( null != (((object)this._restoreFullName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._restoreFullName.ToString()) : null, "restoreFullName" ,container.Add ); + AddIf( null != (((object)this._fileType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileType.ToString()) : null, "fileType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.PowerShell.cs new file mode 100644 index 000000000000..58474019798d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Project Database Details + [System.ComponentModel.TypeConverter(typeof(DatabaseInfoTypeConverter))] + public partial class DatabaseInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfoInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfoInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfoInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfoInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Project Database Details + [System.ComponentModel.TypeConverter(typeof(DatabaseInfoTypeConverter))] + public partial interface IDatabaseInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.TypeConverter.cs new file mode 100644 index 000000000000..30cbeabd1f78 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.cs new file mode 100644 index 000000000000..7901221c7a2d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Project Database Details + public partial class DatabaseInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfoInternal + { + + /// Backing field for property. + private string _sourceDatabaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceDatabaseName { get => this._sourceDatabaseName; set => this._sourceDatabaseName = value; } + + /// Creates an new instance. + public DatabaseInfo() + { + + } + } + /// Project Database Details + public partial interface IDatabaseInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; set; } + + } + /// Project Database Details + internal partial interface IDatabaseInfoInternal + + { + /// Name of the database + string SourceDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.json.cs new file mode 100644 index 000000000000..1906b82b0f72 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseInfo.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Project Database Details + public partial class DatabaseInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceDatabaseName = If( json?.PropertyT("sourceDatabaseName"), out var __jsonSourceDatabaseName) ? (string)__jsonSourceDatabaseName : (string)SourceDatabaseName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceDatabaseName.ToString()) : null, "sourceDatabaseName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.PowerShell.cs new file mode 100644 index 000000000000..3980b372e93b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.PowerShell.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationTypeConverter))] + public partial class DatabaseMigration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationTypeConverter))] + public partial interface IDatabaseMigration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.TypeConverter.cs new file mode 100644 index 000000000000..faf52c03e902 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.cs new file mode 100644 index 000000000000..ad66d9072402 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource. + public partial class DatabaseMigration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(); + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType)""); } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn = value; } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError = value; } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName = value; } + + /// Internal Acessors for SourceSqlConnection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.SourceSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; } + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId = value ?? null; } + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationService { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService = value ?? null; } + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties _property; + + /// Database Migration Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties()); set => this._property = value; } + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError = value ?? null; } + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope = value ?? null; } + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName = value ?? null; } + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName = value ?? null; } + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetDatabaseCollation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public DatabaseMigration() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// Database Migration Resource. + public partial interface IDatabaseMigration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource + { + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration end time.", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorCode { get; } + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorMessage { get; } + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + string MigrationService { get; set; } + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status.", + SerializedName = @"migrationStatus", + PossibleTypes = new [] { typeof(string) })] + string MigrationStatus { get; } + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration has started.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; set; } + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source sql server.", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration start time.", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseCollation { get; set; } + + } + /// Database Migration Resource. + internal partial interface IDatabaseMigrationInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal + { + /// Database migration end time. + global::System.DateTime? EndedOn { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error details in case of migration failure. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get; set; } + /// Error code. + string MigrationFailureErrorCode { get; set; } + /// Error message. + string MigrationFailureErrorMessage { get; set; } + /// ID tracking current migration operation. + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + string MigrationService { get; set; } + /// Migration status. + string MigrationStatus { get; set; } + /// Database Migration Resource properties. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties Property { get; set; } + /// Error message for migration provisioning failure, if any. + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + string ProvisioningState { get; set; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + string Scope { get; set; } + /// Name of the source database. + string SourceDatabaseName { get; set; } + /// Name of the source sql server. + string SourceServerName { get; set; } + /// Source SQL Server connection details. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get; set; } + /// Authentication type. + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + global::System.DateTime? StartedOn { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Database collation to be used for the target database. + string TargetDatabaseCollation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.json.cs new file mode 100644 index 000000000000..92f8ba3a7702 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigration.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource. + public partial class DatabaseMigration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigration(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.PowerShell.cs new file mode 100644 index 000000000000..09d88d63ff8f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A list of Database Migrations. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationListResultTypeConverter))] + public partial class DatabaseMigrationListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A list of Database Migrations. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationListResultTypeConverter))] + public partial interface IDatabaseMigrationListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.TypeConverter.cs new file mode 100644 index 000000000000..b01c2608d0aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.cs new file mode 100644 index 000000000000..df42f8a2cc1f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A list of Database Migrations. + public partial class DatabaseMigrationListResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration[] _value; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration[] Value { get => this._value; } + + /// Creates an new instance. + public DatabaseMigrationListResult() + { + + } + } + /// A list of Database Migrations. + public partial interface IDatabaseMigrationListResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration[] Value { get; } + + } + /// A list of Database Migrations. + internal partial interface IDatabaseMigrationListResultInternal + + { + string NextLink { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.json.cs new file mode 100644 index 000000000000..27fcb5066a49 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationListResult.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A list of Database Migrations. + public partial class DatabaseMigrationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationListResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigration.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigrationListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.PowerShell.cs new file mode 100644 index 000000000000..40166261fb06 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.PowerShell.cs @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource properties. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesTypeConverter))] + public partial class DatabaseMigrationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource properties. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesTypeConverter))] + public partial interface IDatabaseMigrationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.TypeConverter.cs new file mode 100644 index 000000000000..ef5cf85f31f0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.cs new file mode 100644 index 000000000000..4a4bd177c9cb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties. + public partial class DatabaseMigrationProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType _kind; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get => this._kind; set => this._kind = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureError { get => (this._migrationFailureError = this._migrationFailureError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfo()); set { {_migrationFailureError = value;} } } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)MigrationFailureError).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)MigrationFailureError).Code = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)MigrationFailureError).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)MigrationFailureError).Message = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationStatus { get => this._migrationStatus; set { {_migrationStatus = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.SourceServerName { get => this._sourceServerName; set { {_sourceServerName = value;} } } + + /// Internal Acessors for SourceSqlConnection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.SourceSqlConnection { get => (this._sourceSqlConnection = this._sourceSqlConnection ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation()); set { {_sourceSqlConnection = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo _migrationFailureError; + + /// Error details in case of migration failure. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get => (this._migrationFailureError = this._migrationFailureError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfo()); } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)MigrationFailureError).Code; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)MigrationFailureError).Message; } + + /// Backing field for property. + private string _migrationOperationId; + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// Backing field for property. + private string _migrationService; + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationService { get => this._migrationService; set => this._migrationService = value; } + + /// Backing field for property. + private string _migrationStatus; + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationStatus { get => this._migrationStatus; } + + /// Backing field for property. + private string _provisioningError; + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProvisioningError { get => this._provisioningError; set => this._provisioningError = value; } + + /// Backing field for property. + private string _provisioningState; + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _scope; + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _sourceDatabaseName; + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceDatabaseName { get => this._sourceDatabaseName; set => this._sourceDatabaseName = value; } + + /// Backing field for property. + private string _sourceServerName; + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerName { get => this._sourceServerName; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation _sourceSqlConnection; + + /// Source SQL Server connection details. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get => (this._sourceSqlConnection = this._sourceSqlConnection ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation()); set => this._sourceSqlConnection = value; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).Authentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).DataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).EncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).Password = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).TrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)SourceSqlConnection).UserName = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private string _targetDatabaseCollation; + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseCollation { get => this._targetDatabaseCollation; set => this._targetDatabaseCollation = value; } + + /// Creates an new instance. + public DatabaseMigrationProperties() + { + + } + } + /// Database Migration Resource properties. + public partial interface IDatabaseMigrationProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration end time.", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorCode { get; } + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorMessage { get; } + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + string MigrationService { get; set; } + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status.", + SerializedName = @"migrationStatus", + PossibleTypes = new [] { typeof(string) })] + string MigrationStatus { get; } + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration has started.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; set; } + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source sql server.", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration start time.", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseCollation { get; set; } + + } + /// Database Migration Resource properties. + internal partial interface IDatabaseMigrationPropertiesInternal + + { + /// Database migration end time. + global::System.DateTime? EndedOn { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get; set; } + /// Error details in case of migration failure. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get; set; } + /// Error code. + string MigrationFailureErrorCode { get; set; } + /// Error message. + string MigrationFailureErrorMessage { get; set; } + /// ID tracking current migration operation. + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + string MigrationService { get; set; } + /// Migration status. + string MigrationStatus { get; set; } + /// Error message for migration provisioning failure, if any. + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + string ProvisioningState { get; set; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + string Scope { get; set; } + /// Name of the source database. + string SourceDatabaseName { get; set; } + /// Name of the source sql server. + string SourceServerName { get; set; } + /// Source SQL Server connection details. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get; set; } + /// Authentication type. + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + global::System.DateTime? StartedOn { get; set; } + /// Database collation to be used for the target database. + string TargetDatabaseCollation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.json.cs new file mode 100644 index 000000000000..aa5fbbccd742 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationProperties.json.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties. + public partial class DatabaseMigrationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceSqlConnection = If( json?.PropertyT("sourceSqlConnection"), out var __jsonSourceSqlConnection) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation.FromJson(__jsonSourceSqlConnection) : SourceSqlConnection;} + {_migrationFailureError = If( json?.PropertyT("migrationFailureError"), out var __jsonMigrationFailureError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfo.FromJson(__jsonMigrationFailureError) : MigrationFailureError;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_migrationStatus = If( json?.PropertyT("migrationStatus"), out var __jsonMigrationStatus) ? (string)__jsonMigrationStatus : (string)MigrationStatus;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_sourceDatabaseName = If( json?.PropertyT("sourceDatabaseName"), out var __jsonSourceDatabaseName) ? (string)__jsonSourceDatabaseName : (string)SourceDatabaseName;} + {_sourceServerName = If( json?.PropertyT("sourceServerName"), out var __jsonSourceServerName) ? (string)__jsonSourceServerName : (string)SourceServerName;} + {_migrationService = If( json?.PropertyT("migrationService"), out var __jsonMigrationService) ? (string)__jsonMigrationService : (string)MigrationService;} + {_migrationOperationId = If( json?.PropertyT("migrationOperationId"), out var __jsonMigrationOperationId) ? (string)__jsonMigrationOperationId : (string)MigrationOperationId;} + {_targetDatabaseCollation = If( json?.PropertyT("targetDatabaseCollation"), out var __jsonTargetDatabaseCollation) ? (string)__jsonTargetDatabaseCollation : (string)TargetDatabaseCollation;} + {_provisioningError = If( json?.PropertyT("provisioningError"), out var __jsonProvisioningError) ? (string)__jsonProvisioningError : (string)ProvisioningError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("kind") ) + { + case "SqlDb": + { + return new DatabaseMigrationPropertiesSqlDb(json); + } + case "SqlMi": + { + return new DatabaseMigrationPropertiesSqlMi(json); + } + case "SqlVm": + { + return new DatabaseMigrationPropertiesSqlVM(json); + } + } + return new DatabaseMigrationProperties(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceSqlConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceSqlConnection.ToJson(null,serializationMode) : null, "sourceSqlConnection" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._migrationFailureError ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationFailureError.ToJson(null,serializationMode) : null, "migrationFailureError" ,container.Add ); + } + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationStatus.ToString()) : null, "migrationStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + AddIf( null != (((object)this._sourceDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceDatabaseName.ToString()) : null, "sourceDatabaseName" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerName.ToString()) : null, "sourceServerName" ,container.Add ); + } + AddIf( null != (((object)this._migrationService)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationService.ToString()) : null, "migrationService" ,container.Add ); + AddIf( null != (((object)this._migrationOperationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationOperationId.ToString()) : null, "migrationOperationId" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseCollation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseCollation.ToString()) : null, "targetDatabaseCollation" ,container.Add ); + AddIf( null != (((object)this._provisioningError)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provisioningError.ToString()) : null, "provisioningError" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.PowerShell.cs new file mode 100644 index 000000000000..a42d58c478ad --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.PowerShell.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource properties for SQL database. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesSqlDbTypeConverter))] + public partial class DatabaseMigrationPropertiesSqlDb + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationPropertiesSqlDb(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("TargetSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("TableList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TableList = (string[]) content.GetValueForProperty("TableList",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TableList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailMigrationState = (string) content.GetValueForProperty("MigrationStatusDetailMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailMigrationState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailSqlDataCopyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError = (string[]) content.GetValueForProperty("MigrationStatusDetailSqlDataCopyError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MigrationStatusDetailListOfCopyProgressDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[]) content.GetValueForProperty("MigrationStatusDetailListOfCopyProgressDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionDataSource = (string) content.GetValueForProperty("TargetSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionAuthentication = (string) content.GetValueForProperty("TargetSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionUserName = (string) content.GetValueForProperty("TargetSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("TargetSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("TargetSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("TargetSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("TargetSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationPropertiesSqlDb(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("TargetSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("TableList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TableList = (string[]) content.GetValueForProperty("TableList",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TableList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailMigrationState = (string) content.GetValueForProperty("MigrationStatusDetailMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailMigrationState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailSqlDataCopyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError = (string[]) content.GetValueForProperty("MigrationStatusDetailSqlDataCopyError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MigrationStatusDetailListOfCopyProgressDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[]) content.GetValueForProperty("MigrationStatusDetailListOfCopyProgressDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionDataSource = (string) content.GetValueForProperty("TargetSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionAuthentication = (string) content.GetValueForProperty("TargetSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionUserName = (string) content.GetValueForProperty("TargetSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("TargetSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("TargetSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("TargetSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("TargetSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationPropertiesSqlDb(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationPropertiesSqlDb(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource properties for SQL database. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesSqlDbTypeConverter))] + public partial interface IDatabaseMigrationPropertiesSqlDb + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.TypeConverter.cs new file mode 100644 index 000000000000..9a729f132243 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationPropertiesSqlDbTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationPropertiesSqlDb.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationPropertiesSqlDb.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationPropertiesSqlDb.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.cs new file mode 100644 index 000000000000..320349c8bdc5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.cs @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties for SQL database. + public partial class DatabaseMigrationPropertiesSqlDb : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties __databaseMigrationProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties(); + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Kind = value ; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn = value; } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError = value; } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState = value; } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn = value; } + + /// Internal Acessors for MigrationStatusDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal.MigrationStatusDetail { get => (this._migrationStatusDetail = this._migrationStatusDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetails()); set { {_migrationStatusDetail = value;} } } + + /// Internal Acessors for MigrationStatusDetailListOfCopyProgressDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal.MigrationStatusDetailListOfCopyProgressDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).ListOfCopyProgressDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).ListOfCopyProgressDetail = value; } + + /// Internal Acessors for MigrationStatusDetailMigrationState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal.MigrationStatusDetailMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).MigrationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).MigrationState = value; } + + /// Internal Acessors for MigrationStatusDetailSqlDataCopyError + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal.MigrationStatusDetailSqlDataCopyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).SqlDataCopyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).SqlDataCopyError = value; } + + /// Internal Acessors for OfflineConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal.OfflineConfiguration { get => (this._offlineConfiguration = this._offlineConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfiguration()); set { {_offlineConfiguration = value;} } } + + /// Internal Acessors for OfflineConfigurationOffline + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal.OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal)OfflineConfiguration).Offline; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal)OfflineConfiguration).Offline = value; } + + /// Internal Acessors for TargetSqlConnection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal.TargetSqlConnection { get => (this._targetSqlConnection = this._targetSqlConnection ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation()); set { {_targetSqlConnection = value;} } } + + /// Error details in case of migration failure. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage; } + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationOperationId = value ?? null; } + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationService { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationService; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationService = value ?? null; } + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails _migrationStatusDetail; + + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails MigrationStatusDetail { get => (this._migrationStatusDetail = this._migrationStatusDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetails()); } + + /// Details on progress of ADF copy activities. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] MigrationStatusDetailListOfCopyProgressDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).ListOfCopyProgressDetail; } + + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationStatusDetailMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).MigrationState; } + + /// Sql Data Copy errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] MigrationStatusDetailSqlDataCopyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)MigrationStatusDetail).SqlDataCopyError; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration _offlineConfiguration; + + /// Offline configuration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration OfflineConfiguration { get => (this._offlineConfiguration = this._offlineConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfiguration()); } + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal)OfflineConfiguration).Offline; } + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ProvisioningError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningError = value ?? null; } + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Scope = value ?? null; } + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceDatabaseName = value ?? null; } + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName; } + + /// Source SQL Server connection details. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnection = value ?? null /* model class */; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionUserName = value ?? null; } + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn; } + + /// Backing field for property. + private string[] _tableList; + + /// List of tables to copy. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] TableList { get => this._tableList; set => this._tableList = value; } + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetDatabaseCollation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).TargetDatabaseCollation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).TargetDatabaseCollation = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation _targetSqlConnection; + + /// Target SQL DB connection details. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation TargetSqlConnection { get => (this._targetSqlConnection = this._targetSqlConnection ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation()); set => this._targetSqlConnection = value; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).Authentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).DataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).EncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString TargetSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).Password = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).TrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)TargetSqlConnection).UserName = value ?? null; } + + /// Creates an new instance. + public DatabaseMigrationPropertiesSqlDb() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__databaseMigrationProperties), __databaseMigrationProperties); + await eventListener.AssertObjectIsValid(nameof(__databaseMigrationProperties), __databaseMigrationProperties); + } + } + /// Database Migration Resource properties for SQL database. + public partial interface IDatabaseMigrationPropertiesSqlDb : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties + { + /// Details on progress of ADF copy activities. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Details on progress of ADF copy activities.", + SerializedName = @"listOfCopyProgressDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] MigrationStatusDetailListOfCopyProgressDetail { get; } + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current State of Migration.", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(string) })] + string MigrationStatusDetailMigrationState { get; } + /// Sql Data Copy errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Sql Data Copy errors, if any.", + SerializedName = @"sqlDataCopyErrors", + PossibleTypes = new [] { typeof(string) })] + string[] MigrationStatusDetailSqlDataCopyError { get; } + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? OfflineConfigurationOffline { get; } + /// List of tables to copy. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tables to copy.", + SerializedName = @"tableList", + PossibleTypes = new [] { typeof(string) })] + string[] TableList { get; set; } + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string TargetSqlConnectionAuthentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString TargetSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetSqlConnectionUserName { get; set; } + + } + /// Database Migration Resource properties for SQL database. + internal partial interface IDatabaseMigrationPropertiesSqlDbInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal + { + /// Detailed migration status. Not included by default. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails MigrationStatusDetail { get; set; } + /// Details on progress of ADF copy activities. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] MigrationStatusDetailListOfCopyProgressDetail { get; set; } + /// Current State of Migration. + string MigrationStatusDetailMigrationState { get; set; } + /// Sql Data Copy errors, if any. + string[] MigrationStatusDetailSqlDataCopyError { get; set; } + /// Offline configuration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration OfflineConfiguration { get; set; } + /// Offline migration + bool? OfflineConfigurationOffline { get; set; } + /// List of tables to copy. + string[] TableList { get; set; } + /// Target SQL DB connection details. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation TargetSqlConnection { get; set; } + /// Authentication type. + string TargetSqlConnectionAuthentication { get; set; } + /// Data source. + string TargetSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + bool? TargetSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString TargetSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + bool? TargetSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string TargetSqlConnectionUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.json.cs new file mode 100644 index 000000000000..c859329efdd1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlDb.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties for SQL database. + public partial class DatabaseMigrationPropertiesSqlDb + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationPropertiesSqlDb(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __databaseMigrationProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties(json); + {_migrationStatusDetail = If( json?.PropertyT("migrationStatusDetails"), out var __jsonMigrationStatusDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetails.FromJson(__jsonMigrationStatusDetails) : MigrationStatusDetail;} + {_targetSqlConnection = If( json?.PropertyT("targetSqlConnection"), out var __jsonTargetSqlConnection) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformation.FromJson(__jsonTargetSqlConnection) : TargetSqlConnection;} + {_offlineConfiguration = If( json?.PropertyT("offlineConfiguration"), out var __jsonOfflineConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfiguration.FromJson(__jsonOfflineConfiguration) : OfflineConfiguration;} + {_tableList = If( json?.PropertyT("tableList"), out var __jsonTableList) ? If( __jsonTableList as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : TableList;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigrationPropertiesSqlDb(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __databaseMigrationProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._migrationStatusDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationStatusDetail.ToJson(null,serializationMode) : null, "migrationStatusDetails" ,container.Add ); + } + AddIf( null != this._targetSqlConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetSqlConnection.ToJson(null,serializationMode) : null, "targetSqlConnection" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._offlineConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._offlineConfiguration.ToJson(null,serializationMode) : null, "offlineConfiguration" ,container.Add ); + } + if (null != this._tableList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._tableList ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("tableList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.PowerShell.cs new file mode 100644 index 000000000000..4fd77f075ed8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.PowerShell.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource properties for SQL Managed Instance. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesSqlMiTypeConverter))] + public partial class DatabaseMigrationPropertiesSqlMi + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationPropertiesSqlMi(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationPropertiesSqlMi(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationPropertiesSqlMi(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationPropertiesSqlMi(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource properties for SQL Managed Instance. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesSqlMiTypeConverter))] + public partial interface IDatabaseMigrationPropertiesSqlMi + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.TypeConverter.cs new file mode 100644 index 000000000000..1fc1730e06a7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationPropertiesSqlMiTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationPropertiesSqlMi.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationPropertiesSqlMi.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationPropertiesSqlMi.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.cs new file mode 100644 index 000000000000..71be925718c8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.cs @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties for SQL Managed Instance. + public partial class DatabaseMigrationPropertiesSqlMi : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties __databaseMigrationProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties(); + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobAccountKey = value ?? null; } + + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobContainerName = value ?? null; } + + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobStorageAccountResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration _backupConfiguration; + + /// Backup configuration info. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration BackupConfiguration { get => (this._backupConfiguration = this._backupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfiguration()); set => this._backupConfiguration = value; } + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn; } + + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString FileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePassword = value ?? null; } + + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePath = value ?? null; } + + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileShareUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileShareUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileShareUsername = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Kind = value ; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn = value; } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError = value; } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState = value; } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn = value; } + + /// Internal Acessors for BackupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.BackupConfiguration { get => (this._backupConfiguration = this._backupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfiguration()); set { {_backupConfiguration = value;} } } + + /// Internal Acessors for BackupConfigurationSourceLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.BackupConfigurationSourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocation = value; } + + /// Internal Acessors for BackupConfigurationTargetLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.BackupConfigurationTargetLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocation = value; } + + /// Internal Acessors for MigrationStatusDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.MigrationStatusDetail { get => (this._migrationStatusDetail = this._migrationStatusDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails()); set { {_migrationStatusDetail = value;} } } + + /// Internal Acessors for OfflineConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.OfflineConfiguration { get => (this._offlineConfiguration = this._offlineConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration()); set { {_offlineConfiguration = value;} } } + + /// Internal Acessors for SourceLocationAzureBlob + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.SourceLocationAzureBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationAzureBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationAzureBlob = value; } + + /// Internal Acessors for SourceLocationFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.SourceLocationFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileShare = value; } + + /// Internal Acessors for SourceLocationFileStorageType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal.SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileStorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileStorageType = value; } + + /// Error details in case of migration failure. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage; } + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationOperationId = value ?? null; } + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationService { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationService; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationService = value ?? null; } + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails _migrationStatusDetail; + + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get => (this._migrationStatusDetail = this._migrationStatusDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration _offlineConfiguration; + + /// Offline configuration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration OfflineConfiguration { get => (this._offlineConfiguration = this._offlineConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration()); set => this._offlineConfiguration = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string OfflineConfigurationLastBackupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).LastBackupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).LastBackupName = value ?? null; } + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).Offline; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).Offline = value ?? default(bool); } + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ProvisioningError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningError = value ?? null; } + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Scope = value ?? null; } + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceDatabaseName = value ?? null; } + + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileStorageType; } + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName; } + + /// Source SQL Server connection details. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnection = value ?? null /* model class */; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionUserName = value ?? null; } + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn; } + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetDatabaseCollation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).TargetDatabaseCollation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).TargetDatabaseCollation = value ?? null; } + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationAccountKey = value ?? null; } + + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationStorageAccountResourceId = value ?? null; } + + /// Creates an new instance. + public DatabaseMigrationPropertiesSqlMi() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__databaseMigrationProperties), __databaseMigrationProperties); + await eventListener.AssertObjectIsValid(nameof(__databaseMigrationProperties), __databaseMigrationProperties); + } + } + /// Database Migration Resource properties for SQL Managed Instance. + public partial interface IDatabaseMigrationPropertiesSqlMi : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobStorageAccountResourceId { get; set; } + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string FileShareUsername { get; set; } + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Detailed migration status. Not included by default.", + SerializedName = @"migrationStatusDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"lastBackupName", + PossibleTypes = new [] { typeof(string) })] + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? OfflineConfigurationOffline { get; set; } + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup storage Type.", + SerializedName = @"fileStorageType", + PossibleTypes = new [] { typeof(string) })] + string SourceLocationFileStorageType { get; } + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationStorageAccountResourceId { get; set; } + + } + /// Database Migration Resource properties for SQL Managed Instance. + internal partial interface IDatabaseMigrationPropertiesSqlMiInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal + { + /// Storage Account Key. + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + string AzureBlobStorageAccountResourceId { get; set; } + /// Backup configuration info. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration BackupConfiguration { get; set; } + /// Source location of backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation BackupConfigurationSourceLocation { get; set; } + /// Target location for copying backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation BackupConfigurationTargetLocation { get; set; } + /// Password for username to access file share location. + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + string FileShareUsername { get; set; } + /// Detailed migration status. Not included by default. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; set; } + /// Offline configuration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration OfflineConfiguration { get; set; } + /// + /// 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. + /// + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + bool? OfflineConfigurationOffline { get; set; } + /// Source Azure Blob. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob SourceLocationAzureBlob { get; set; } + /// Source File share. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare SourceLocationFileShare { get; set; } + /// Backup storage Type. + string SourceLocationFileStorageType { get; set; } + /// Storage Account Key. + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + string TargetLocationStorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.json.cs new file mode 100644 index 000000000000..7f2943a3601f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlMi.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties for SQL Managed Instance. + public partial class DatabaseMigrationPropertiesSqlMi + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationPropertiesSqlMi(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __databaseMigrationProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties(json); + {_backupConfiguration = If( json?.PropertyT("backupConfiguration"), out var __jsonBackupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfiguration.FromJson(__jsonBackupConfiguration) : BackupConfiguration;} + {_offlineConfiguration = If( json?.PropertyT("offlineConfiguration"), out var __jsonOfflineConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration.FromJson(__jsonOfflineConfiguration) : OfflineConfiguration;} + {_migrationStatusDetail = If( json?.PropertyT("migrationStatusDetails"), out var __jsonMigrationStatusDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails.FromJson(__jsonMigrationStatusDetails) : MigrationStatusDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigrationPropertiesSqlMi(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __databaseMigrationProperties?.ToJson(container, serializationMode); + AddIf( null != this._backupConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupConfiguration.ToJson(null,serializationMode) : null, "backupConfiguration" ,container.Add ); + AddIf( null != this._offlineConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._offlineConfiguration.ToJson(null,serializationMode) : null, "offlineConfiguration" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._migrationStatusDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationStatusDetail.ToJson(null,serializationMode) : null, "migrationStatusDetails" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.PowerShell.cs new file mode 100644 index 000000000000..af41ce66aca9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.PowerShell.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource properties for SQL Virtual Machine. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesSqlVMTypeConverter))] + public partial class DatabaseMigrationPropertiesSqlVM + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationPropertiesSqlVM(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationPropertiesSqlVM(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationPropertiesSqlVM(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationPropertiesSqlVM(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource properties for SQL Virtual Machine. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationPropertiesSqlVMTypeConverter))] + public partial interface IDatabaseMigrationPropertiesSqlVM + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.TypeConverter.cs new file mode 100644 index 000000000000..d66804d41e49 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationPropertiesSqlVMTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationPropertiesSqlVM.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationPropertiesSqlVM.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationPropertiesSqlVM.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.cs new file mode 100644 index 000000000000..e47abf10be7d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.cs @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties for SQL Virtual Machine. + public partial class DatabaseMigrationPropertiesSqlVM : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties __databaseMigrationProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties(); + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobAccountKey = value ?? null; } + + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobContainerName = value ?? null; } + + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).AzureBlobStorageAccountResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration _backupConfiguration; + + /// Backup configuration info. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration BackupConfiguration { get => (this._backupConfiguration = this._backupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfiguration()); set => this._backupConfiguration = value; } + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn; } + + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString FileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePassword = value ?? null; } + + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileSharePath = value ?? null; } + + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileShareUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileShareUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).FileShareUsername = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Kind = value ; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).EndedOn = value; } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError = value; } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState = value; } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn = value; } + + /// Internal Acessors for BackupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.BackupConfiguration { get => (this._backupConfiguration = this._backupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfiguration()); set { {_backupConfiguration = value;} } } + + /// Internal Acessors for BackupConfigurationSourceLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.BackupConfigurationSourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocation = value; } + + /// Internal Acessors for BackupConfigurationTargetLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.BackupConfigurationTargetLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocation = value; } + + /// Internal Acessors for MigrationStatusDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.MigrationStatusDetail { get => (this._migrationStatusDetail = this._migrationStatusDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails()); set { {_migrationStatusDetail = value;} } } + + /// Internal Acessors for OfflineConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.OfflineConfiguration { get => (this._offlineConfiguration = this._offlineConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration()); set { {_offlineConfiguration = value;} } } + + /// Internal Acessors for SourceLocationAzureBlob + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.SourceLocationAzureBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationAzureBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationAzureBlob = value; } + + /// Internal Acessors for SourceLocationFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.SourceLocationFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileShare = value; } + + /// Internal Acessors for SourceLocationFileStorageType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal.SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileStorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileStorageType = value; } + + /// Error details in case of migration failure. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureError; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorCode; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationFailureErrorMessage; } + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationOperationId = value ?? null; } + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationService { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationService; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationService = value ?? null; } + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).MigrationStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails _migrationStatusDetail; + + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get => (this._migrationStatusDetail = this._migrationStatusDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration _offlineConfiguration; + + /// Offline configuration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration OfflineConfiguration { get => (this._offlineConfiguration = this._offlineConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration()); set => this._offlineConfiguration = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string OfflineConfigurationLastBackupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).LastBackupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).LastBackupName = value ?? null; } + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).Offline; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)OfflineConfiguration).Offline = value ?? default(bool); } + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ProvisioningError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningError = value ?? null; } + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).ProvisioningState; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).Scope = value ?? null; } + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceDatabaseName = value ?? null; } + + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).SourceLocationFileStorageType; } + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceServerName; } + + /// Source SQL Server connection details. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnection = value ?? null /* model class */; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).SourceSqlConnectionUserName = value ?? null; } + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).StartedOn; } + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetDatabaseCollation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).TargetDatabaseCollation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)__databaseMigrationProperties).TargetDatabaseCollation = value ?? null; } + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationAccountKey = value ?? null; } + + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfigurationInternal)BackupConfiguration).TargetLocationStorageAccountResourceId = value ?? null; } + + /// Creates an new instance. + public DatabaseMigrationPropertiesSqlVM() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__databaseMigrationProperties), __databaseMigrationProperties); + await eventListener.AssertObjectIsValid(nameof(__databaseMigrationProperties), __databaseMigrationProperties); + } + } + /// Database Migration Resource properties for SQL Virtual Machine. + public partial interface IDatabaseMigrationPropertiesSqlVM : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationProperties + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobStorageAccountResourceId { get; set; } + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string FileShareUsername { get; set; } + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Detailed migration status. Not included by default.", + SerializedName = @"migrationStatusDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"lastBackupName", + PossibleTypes = new [] { typeof(string) })] + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? OfflineConfigurationOffline { get; set; } + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup storage Type.", + SerializedName = @"fileStorageType", + PossibleTypes = new [] { typeof(string) })] + string SourceLocationFileStorageType { get; } + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationStorageAccountResourceId { get; set; } + + } + /// Database Migration Resource properties for SQL Virtual Machine. + internal partial interface IDatabaseMigrationPropertiesSqlVMInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal + { + /// Storage Account Key. + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + string AzureBlobStorageAccountResourceId { get; set; } + /// Backup configuration info. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration BackupConfiguration { get; set; } + /// Source location of backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation BackupConfigurationSourceLocation { get; set; } + /// Target location for copying backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation BackupConfigurationTargetLocation { get; set; } + /// Password for username to access file share location. + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + string FileShareUsername { get; set; } + /// Detailed migration status. Not included by default. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; set; } + /// Offline configuration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration OfflineConfiguration { get; set; } + /// + /// 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. + /// + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + bool? OfflineConfigurationOffline { get; set; } + /// Source Azure Blob. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob SourceLocationAzureBlob { get; set; } + /// Source File share. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare SourceLocationFileShare { get; set; } + /// Backup storage Type. + string SourceLocationFileStorageType { get; set; } + /// Storage Account Key. + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + string TargetLocationStorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.json.cs new file mode 100644 index 000000000000..dc5cd0fcd846 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationPropertiesSqlVM.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource properties for SQL Virtual Machine. + public partial class DatabaseMigrationPropertiesSqlVM + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationPropertiesSqlVM(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __databaseMigrationProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationProperties(json); + {_backupConfiguration = If( json?.PropertyT("backupConfiguration"), out var __jsonBackupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfiguration.FromJson(__jsonBackupConfiguration) : BackupConfiguration;} + {_offlineConfiguration = If( json?.PropertyT("offlineConfiguration"), out var __jsonOfflineConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfiguration.FromJson(__jsonOfflineConfiguration) : OfflineConfiguration;} + {_migrationStatusDetail = If( json?.PropertyT("migrationStatusDetails"), out var __jsonMigrationStatusDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetails.FromJson(__jsonMigrationStatusDetails) : MigrationStatusDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigrationPropertiesSqlVM(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __databaseMigrationProperties?.ToJson(container, serializationMode); + AddIf( null != this._backupConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupConfiguration.ToJson(null,serializationMode) : null, "backupConfiguration" ,container.Add ); + AddIf( null != this._offlineConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._offlineConfiguration.ToJson(null,serializationMode) : null, "offlineConfiguration" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._migrationStatusDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationStatusDetail.ToJson(null,serializationMode) : null, "migrationStatusDetails" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.PowerShell.cs new file mode 100644 index 000000000000..31f02a8a545c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.PowerShell.cs @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource for SQL Database. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationSqlDbTypeConverter))] + public partial class DatabaseMigrationSqlDb + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationSqlDb(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlDbTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("TargetSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("TableList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TableList = (string[]) content.GetValueForProperty("TableList",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TableList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailMigrationState = (string) content.GetValueForProperty("MigrationStatusDetailMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailMigrationState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailSqlDataCopyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError = (string[]) content.GetValueForProperty("MigrationStatusDetailSqlDataCopyError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MigrationStatusDetailListOfCopyProgressDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[]) content.GetValueForProperty("MigrationStatusDetailListOfCopyProgressDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionDataSource = (string) content.GetValueForProperty("TargetSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionAuthentication = (string) content.GetValueForProperty("TargetSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionUserName = (string) content.GetValueForProperty("TargetSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("TargetSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("TargetSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("TargetSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("TargetSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationSqlDb(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlDbTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbMigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("TargetSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlDbOfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("TableList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TableList = (string[]) content.GetValueForProperty("TableList",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TableList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailMigrationState = (string) content.GetValueForProperty("MigrationStatusDetailMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailMigrationState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetailSqlDataCopyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError = (string[]) content.GetValueForProperty("MigrationStatusDetailSqlDataCopyError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailSqlDataCopyError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MigrationStatusDetailListOfCopyProgressDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[]) content.GetValueForProperty("MigrationStatusDetailListOfCopyProgressDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).MigrationStatusDetailListOfCopyProgressDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionDataSource = (string) content.GetValueForProperty("TargetSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionAuthentication = (string) content.GetValueForProperty("TargetSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionUserName = (string) content.GetValueForProperty("TargetSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("TargetSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("TargetSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("TargetSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("TargetSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).TargetSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationSqlDb(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationSqlDb(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource for SQL Database. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationSqlDbTypeConverter))] + public partial interface IDatabaseMigrationSqlDb + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.TypeConverter.cs new file mode 100644 index 000000000000..1fd4d976be80 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationSqlDbTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationSqlDb.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationSqlDb.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationSqlDb.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.cs new file mode 100644 index 000000000000..7fb0eff6cdab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.cs @@ -0,0 +1,673 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource for SQL Database. + public partial class DatabaseMigrationSqlDb : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(); + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType)""); } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn = value; } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError = value; } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus = value; } + + /// Internal Acessors for MigrationStatusDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationStatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetail = value; } + + /// Internal Acessors for MigrationStatusDetailListOfCopyProgressDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationStatusDetailListOfCopyProgressDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailListOfCopyProgressDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailListOfCopyProgressDetail = value; } + + /// Internal Acessors for MigrationStatusDetailMigrationState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationStatusDetailMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailMigrationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailMigrationState = value; } + + /// Internal Acessors for MigrationStatusDetailSqlDataCopyError + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.MigrationStatusDetailSqlDataCopyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailSqlDataCopyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailSqlDataCopyError = value; } + + /// Internal Acessors for OfflineConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.OfflineConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).OfflineConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).OfflineConfiguration = value; } + + /// Internal Acessors for OfflineConfigurationOffline + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).OfflineConfigurationOffline; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).OfflineConfigurationOffline = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlDb()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName = value; } + + /// Internal Acessors for SourceSqlConnection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.SourceSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for TargetSqlConnection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDbInternal.TargetSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnection = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; } + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId = value ?? null; } + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationService { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService = value ?? null; } + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; } + + /// Details on progress of ADF copy activities. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] MigrationStatusDetailListOfCopyProgressDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailListOfCopyProgressDetail; } + + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationStatusDetailMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailMigrationState; } + + /// Sql Data Copy errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] MigrationStatusDetailSqlDataCopyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).MigrationStatusDetailSqlDataCopyError; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; } + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).OfflineConfigurationOffline; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb _property; + + /// Database Migration Resource properties for SQL database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlDb()); set => this._property = value; } + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError = value ?? null; } + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope = value ?? null; } + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName = value ?? null; } + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName = value ?? null; } + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// List of tables to copy. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] TableList { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TableList; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TableList = value ?? null /* arrayOf */; } + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetDatabaseCollation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation = value ?? null; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString TargetSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDbInternal)Property).TargetSqlConnectionUserName = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public DatabaseMigrationSqlDb() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// Database Migration Resource for SQL Database. + public partial interface IDatabaseMigrationSqlDb : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource + { + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration end time.", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorCode { get; } + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorMessage { get; } + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + string MigrationService { get; set; } + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status.", + SerializedName = @"migrationStatus", + PossibleTypes = new [] { typeof(string) })] + string MigrationStatus { get; } + /// Details on progress of ADF copy activities. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Details on progress of ADF copy activities.", + SerializedName = @"listOfCopyProgressDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] MigrationStatusDetailListOfCopyProgressDetail { get; } + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current State of Migration.", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(string) })] + string MigrationStatusDetailMigrationState { get; } + /// Sql Data Copy errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Sql Data Copy errors, if any.", + SerializedName = @"sqlDataCopyErrors", + PossibleTypes = new [] { typeof(string) })] + string[] MigrationStatusDetailSqlDataCopyError { get; } + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? OfflineConfigurationOffline { get; } + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration has started.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; set; } + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source sql server.", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration start time.", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// List of tables to copy. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tables to copy.", + SerializedName = @"tableList", + PossibleTypes = new [] { typeof(string) })] + string[] TableList { get; set; } + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseCollation { get; set; } + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string TargetSqlConnectionAuthentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString TargetSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetSqlConnectionUserName { get; set; } + + } + /// Database Migration Resource for SQL Database. + internal partial interface IDatabaseMigrationSqlDbInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal + { + /// Database migration end time. + global::System.DateTime? EndedOn { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error details in case of migration failure. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get; set; } + /// Error code. + string MigrationFailureErrorCode { get; set; } + /// Error message. + string MigrationFailureErrorMessage { get; set; } + /// ID tracking current migration operation. + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + string MigrationService { get; set; } + /// Migration status. + string MigrationStatus { get; set; } + /// Detailed migration status. Not included by default. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails MigrationStatusDetail { get; set; } + /// Details on progress of ADF copy activities. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] MigrationStatusDetailListOfCopyProgressDetail { get; set; } + /// Current State of Migration. + string MigrationStatusDetailMigrationState { get; set; } + /// Sql Data Copy errors, if any. + string[] MigrationStatusDetailSqlDataCopyError { get; set; } + /// Offline configuration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration OfflineConfiguration { get; set; } + /// Offline migration + bool? OfflineConfigurationOffline { get; set; } + /// Database Migration Resource properties for SQL database. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlDb Property { get; set; } + /// Error message for migration provisioning failure, if any. + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + string ProvisioningState { get; set; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + string Scope { get; set; } + /// Name of the source database. + string SourceDatabaseName { get; set; } + /// Name of the source sql server. + string SourceServerName { get; set; } + /// Source SQL Server connection details. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get; set; } + /// Authentication type. + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + global::System.DateTime? StartedOn { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// List of tables to copy. + string[] TableList { get; set; } + /// Database collation to be used for the target database. + string TargetDatabaseCollation { get; set; } + /// Target SQL DB connection details. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation TargetSqlConnection { get; set; } + /// Authentication type. + string TargetSqlConnectionAuthentication { get; set; } + /// Data source. + string TargetSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + bool? TargetSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString TargetSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + bool? TargetSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string TargetSqlConnectionUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.json.cs new file mode 100644 index 000000000000..55786bc909bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlDb.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource for SQL Database. + public partial class DatabaseMigrationSqlDb + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationSqlDb(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlDb.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigrationSqlDb(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.PowerShell.cs new file mode 100644 index 000000000000..65612b210186 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.PowerShell.cs @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource for SQL Managed Instance. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationSqlMiTypeConverter))] + public partial class DatabaseMigrationSqlMi + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationSqlMi(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlMiTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationSqlMi(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlMiTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationSqlMi(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationSqlMi(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource for SQL Managed Instance. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationSqlMiTypeConverter))] + public partial interface IDatabaseMigrationSqlMi + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.TypeConverter.cs new file mode 100644 index 000000000000..b9b15ad25ce7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationSqlMiTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationSqlMi.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationSqlMi.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationSqlMi.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.cs new file mode 100644 index 000000000000..0af22704b4f3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.cs @@ -0,0 +1,705 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource for SQL Managed Instance. + public partial class DatabaseMigrationSqlMi : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(); + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).AzureBlobAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).AzureBlobAccountKey = value ?? null; } + + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).AzureBlobContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).AzureBlobContainerName = value ?? null; } + + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).AzureBlobStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).AzureBlobStorageAccountResourceId = value ?? null; } + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; } + + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString FileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).FileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).FileSharePassword = value ?? null; } + + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).FileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).FileSharePath = value ?? null; } + + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileShareUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).FileShareUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).FileShareUsername = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType)""); } + + /// Internal Acessors for BackupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.BackupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).BackupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).BackupConfiguration = value; } + + /// Internal Acessors for BackupConfigurationSourceLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.BackupConfigurationSourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).BackupConfigurationSourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).BackupConfigurationSourceLocation = value; } + + /// Internal Acessors for BackupConfigurationTargetLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.BackupConfigurationTargetLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).BackupConfigurationTargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).BackupConfigurationTargetLocation = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn = value; } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError = value; } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus = value; } + + /// Internal Acessors for MigrationStatusDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.MigrationStatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).MigrationStatusDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).MigrationStatusDetail = value; } + + /// Internal Acessors for OfflineConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.OfflineConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).OfflineConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).OfflineConfiguration = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlMi()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SourceLocationAzureBlob + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.SourceLocationAzureBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).SourceLocationAzureBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).SourceLocationAzureBlob = value; } + + /// Internal Acessors for SourceLocationFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.SourceLocationFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).SourceLocationFileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).SourceLocationFileShare = value; } + + /// Internal Acessors for SourceLocationFileStorageType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).SourceLocationFileStorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).SourceLocationFileStorageType = value; } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName = value; } + + /// Internal Acessors for SourceSqlConnection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.SourceSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMiInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; } + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId = value ?? null; } + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationService { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService = value ?? null; } + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; } + + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).MigrationStatusDetail; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; } + + /// + /// Last backup name for offline migration. This is optional for migrations from file share. If it is not provided, then the + /// service will determine the last backup file name based on latest backup files present in file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string OfflineConfigurationLastBackupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).OfflineConfigurationLastBackupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).OfflineConfigurationLastBackupName = value ?? null; } + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).OfflineConfigurationOffline; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).OfflineConfigurationOffline = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi _property; + + /// Database Migration Resource properties for SQL Managed Instance. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlMi()); set => this._property = value; } + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError = value ?? null; } + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope = value ?? null; } + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName = value ?? null; } + + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).SourceLocationFileStorageType; } + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName = value ?? null; } + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetDatabaseCollation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation = value ?? null; } + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).TargetLocationAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).TargetLocationAccountKey = value ?? null; } + + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).TargetLocationStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMiInternal)Property).TargetLocationStorageAccountResourceId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public DatabaseMigrationSqlMi() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// Database Migration Resource for SQL Managed Instance. + public partial interface IDatabaseMigrationSqlMi : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobStorageAccountResourceId { get; set; } + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration end time.", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string FileShareUsername { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorCode { get; } + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorMessage { get; } + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + string MigrationService { get; set; } + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status.", + SerializedName = @"migrationStatus", + PossibleTypes = new [] { typeof(string) })] + string MigrationStatus { get; } + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Detailed migration status. Not included by default.", + SerializedName = @"migrationStatusDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"lastBackupName", + PossibleTypes = new [] { typeof(string) })] + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? OfflineConfigurationOffline { get; set; } + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration has started.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; set; } + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup storage Type.", + SerializedName = @"fileStorageType", + PossibleTypes = new [] { typeof(string) })] + string SourceLocationFileStorageType { get; } + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source sql server.", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration start time.", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseCollation { get; set; } + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationStorageAccountResourceId { get; set; } + + } + /// Database Migration Resource for SQL Managed Instance. + internal partial interface IDatabaseMigrationSqlMiInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal + { + /// Storage Account Key. + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + string AzureBlobStorageAccountResourceId { get; set; } + /// Backup configuration info. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration BackupConfiguration { get; set; } + /// Source location of backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation BackupConfigurationSourceLocation { get; set; } + /// Target location for copying backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation BackupConfigurationTargetLocation { get; set; } + /// Database migration end time. + global::System.DateTime? EndedOn { get; set; } + /// Password for username to access file share location. + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + string FileShareUsername { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error details in case of migration failure. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get; set; } + /// Error code. + string MigrationFailureErrorCode { get; set; } + /// Error message. + string MigrationFailureErrorMessage { get; set; } + /// ID tracking current migration operation. + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + string MigrationService { get; set; } + /// Migration status. + string MigrationStatus { get; set; } + /// Detailed migration status. Not included by default. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; set; } + /// Offline configuration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration OfflineConfiguration { get; set; } + /// + /// 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. + /// + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + bool? OfflineConfigurationOffline { get; set; } + /// Database Migration Resource properties for SQL Managed Instance. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlMi Property { get; set; } + /// Error message for migration provisioning failure, if any. + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + string ProvisioningState { get; set; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + string Scope { get; set; } + /// Name of the source database. + string SourceDatabaseName { get; set; } + /// Source Azure Blob. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob SourceLocationAzureBlob { get; set; } + /// Source File share. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare SourceLocationFileShare { get; set; } + /// Backup storage Type. + string SourceLocationFileStorageType { get; set; } + /// Name of the source sql server. + string SourceServerName { get; set; } + /// Source SQL Server connection details. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get; set; } + /// Authentication type. + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + global::System.DateTime? StartedOn { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Database collation to be used for the target database. + string TargetDatabaseCollation { get; set; } + /// Storage Account Key. + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + string TargetLocationStorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.json.cs new file mode 100644 index 000000000000..f1d85e6b7188 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlMi.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource for SQL Managed Instance. + public partial class DatabaseMigrationSqlMi + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationSqlMi(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlMi.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigrationSqlMi(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.PowerShell.cs new file mode 100644 index 000000000000..6cb6f01962b1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.PowerShell.cs @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database Migration Resource for SQL Virtual Machine. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationSqlVMTypeConverter))] + public partial class DatabaseMigrationSqlVM + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseMigrationSqlVM(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlVMTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseMigrationSqlVM(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlVMTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration) content.GetValueForProperty("BackupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("OfflineConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration) content.GetValueForProperty("OfflineConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OfflineConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceSqlConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation) content.GetValueForProperty("SourceSqlConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInformationTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationFailureError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo) content.GetValueForProperty("MigrationFailureError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ErrorInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType.CreateFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatus = (string) content.GetValueForProperty("MigrationStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatus, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("MigrationService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationService = (string) content.GetValueForProperty("MigrationService",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationService, global::System.Convert.ToString); + } + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseCollation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetDatabaseCollation = (string) content.GetValueForProperty("TargetDatabaseCollation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetDatabaseCollation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningError = (string) content.GetValueForProperty("ProvisioningError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).ProvisioningError, global::System.Convert.ToString); + } + if (content.Contains("MigrationStatusDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatusDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) content.GetValueForProperty("MigrationStatusDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationStatusDetail, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationStatusDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationSourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationSourceLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation) content.GetValueForProperty("BackupConfigurationSourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationSourceLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SourceLocationTypeConverter.ConvertFrom); + } + if (content.Contains("BackupConfigurationTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationTargetLocation = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation) content.GetValueForProperty("BackupConfigurationTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).BackupConfigurationTargetLocation, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TargetLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSqlConnectionDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionDataSource = (string) content.GetValueForProperty("SourceSqlConnectionDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionAuthentication = (string) content.GetValueForProperty("SourceSqlConnectionAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionAuthentication, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionUserName = (string) content.GetValueForProperty("SourceSqlConnectionUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceSqlConnectionPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionPassword = (System.Security.SecureString) content.GetValueForProperty("SourceSqlConnectionPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("SourceSqlConnectionEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionEncryptConnection = (bool?) content.GetValueForProperty("SourceSqlConnectionEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceSqlConnectionTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionTrustServerCertificate = (bool?) content.GetValueForProperty("SourceSqlConnectionTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceSqlConnectionTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationFailureErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorCode = (string) content.GetValueForProperty("MigrationFailureErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorCode, global::System.Convert.ToString); + } + if (content.Contains("MigrationFailureErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorMessage = (string) content.GetValueForProperty("MigrationFailureErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).MigrationFailureErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationAzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationAzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("SourceLocationAzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationAzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("TargetLocationAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationAccountKey = (string) content.GetValueForProperty("TargetLocationAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationAccountKey, global::System.Convert.ToString); + } + if (content.Contains("OfflineConfigurationOffline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationOffline = (bool?) content.GetValueForProperty("OfflineConfigurationOffline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationOffline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OfflineConfigurationLastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationLastBackupName = (string) content.GetValueForProperty("OfflineConfigurationLastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).OfflineConfigurationLastBackupName, global::System.Convert.ToString); + } + if (content.Contains("SourceLocationFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("SourceLocationFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceLocationFileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileStorageType = (string) content.GetValueForProperty("SourceLocationFileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).SourceLocationFileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("TargetLocationStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationStorageAccountResourceId = (string) content.GetValueForProperty("TargetLocationStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).TargetLocationStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseMigrationSqlVM(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseMigrationSqlVM(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database Migration Resource for SQL Virtual Machine. + [System.ComponentModel.TypeConverter(typeof(DatabaseMigrationSqlVMTypeConverter))] + public partial interface IDatabaseMigrationSqlVM + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.TypeConverter.cs new file mode 100644 index 000000000000..dbb990856069 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseMigrationSqlVMTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseMigrationSqlVM.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseMigrationSqlVM.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseMigrationSqlVM.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.cs new file mode 100644 index 000000000000..a8f32a65c74a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.cs @@ -0,0 +1,705 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource for SQL Virtual Machine. + public partial class DatabaseMigrationSqlVM : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(); + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).AzureBlobAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).AzureBlobAccountKey = value ?? null; } + + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).AzureBlobContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).AzureBlobContainerName = value ?? null; } + + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).AzureBlobStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).AzureBlobStorageAccountResourceId = value ?? null; } + + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; } + + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString FileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).FileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).FileSharePassword = value ?? null; } + + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).FileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).FileSharePath = value ?? null; } + + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileShareUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).FileShareUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).FileShareUsername = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType)""); } + + /// Internal Acessors for BackupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.BackupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).BackupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).BackupConfiguration = value; } + + /// Internal Acessors for BackupConfigurationSourceLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.BackupConfigurationSourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).BackupConfigurationSourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).BackupConfigurationSourceLocation = value; } + + /// Internal Acessors for BackupConfigurationTargetLocation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.BackupConfigurationTargetLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).BackupConfigurationTargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).BackupConfigurationTargetLocation = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).EndedOn = value; } + + /// Internal Acessors for MigrationFailureError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.MigrationFailureError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureError = value; } + + /// Internal Acessors for MigrationFailureErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode = value; } + + /// Internal Acessors for MigrationFailureErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage = value; } + + /// Internal Acessors for MigrationStatus + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus = value; } + + /// Internal Acessors for MigrationStatusDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.MigrationStatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).MigrationStatusDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).MigrationStatusDetail = value; } + + /// Internal Acessors for OfflineConfiguration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.OfflineConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).OfflineConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).OfflineConfiguration = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlVM()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SourceLocationAzureBlob + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.SourceLocationAzureBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).SourceLocationAzureBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).SourceLocationAzureBlob = value; } + + /// Internal Acessors for SourceLocationFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.SourceLocationFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).SourceLocationFileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).SourceLocationFileShare = value; } + + /// Internal Acessors for SourceLocationFileStorageType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).SourceLocationFileStorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).SourceLocationFileStorageType = value; } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName = value; } + + /// Internal Acessors for SourceSqlConnection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.SourceSqlConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnection = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVMInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorCode; } + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationFailureErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationFailureErrorMessage; } + + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationOperationId = value ?? null; } + + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationService { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationService = value ?? null; } + + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).MigrationStatus; } + + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).MigrationStatusDetail; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Name; } + + /// + /// Last backup name for offline migration. This is optional for migrations from file share. If it is not provided, then the + /// service will determine the last backup file name based on latest backup files present in file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string OfflineConfigurationLastBackupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).OfflineConfigurationLastBackupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).OfflineConfigurationLastBackupName = value ?? null; } + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? OfflineConfigurationOffline { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).OfflineConfigurationOffline; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).OfflineConfigurationOffline = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM _property; + + /// Database Migration Resource properties for SQL Virtual Machine. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlVM()); set => this._property = value; } + + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningError = value ?? null; } + + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).ProvisioningState; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).Scope = value ?? null; } + + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceDatabaseName = value ?? null; } + + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceLocationFileStorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).SourceLocationFileStorageType; } + + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceServerName; } + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionAuthentication = value ?? null; } + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionDataSource = value ?? null; } + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionEncryptConnection = value ?? default(bool); } + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString SourceSqlConnectionPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionPassword = value ?? null; } + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceSqlConnectionTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionTrustServerCertificate = value ?? default(bool); } + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceSqlConnectionUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).SourceSqlConnectionUserName = value ?? null; } + + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).StartedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetDatabaseCollation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesInternal)Property).TargetDatabaseCollation = value ?? null; } + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).TargetLocationAccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).TargetLocationAccountKey = value ?? null; } + + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetLocationStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).TargetLocationStorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVMInternal)Property).TargetLocationStorageAccountResourceId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public DatabaseMigrationSqlVM() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// Database Migration Resource for SQL Virtual Machine. + public partial interface IDatabaseMigrationSqlVM : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobStorageAccountResourceId { get; set; } + /// Database migration end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration end time.", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string FileShareUsername { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorCode { get; } + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string MigrationFailureErrorMessage { get; } + /// ID tracking current migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + string MigrationService { get; set; } + /// Migration status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status.", + SerializedName = @"migrationStatus", + PossibleTypes = new [] { typeof(string) })] + string MigrationStatus { get; } + /// Detailed migration status. Not included by default. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Detailed migration status. Not included by default.", + SerializedName = @"migrationStatusDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"lastBackupName", + PossibleTypes = new [] { typeof(string) })] + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? OfflineConfigurationOffline { get; set; } + /// Error message for migration provisioning failure, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration has started.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// Name of the source database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; set; } + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup storage Type.", + SerializedName = @"fileStorageType", + PossibleTypes = new [] { typeof(string) })] + string SourceLocationFileStorageType { get; } + /// Name of the source sql server. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source sql server.", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration start time.", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Database collation to be used for the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseCollation { get; set; } + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetLocationStorageAccountResourceId { get; set; } + + } + /// Database Migration Resource for SQL Virtual Machine. + internal partial interface IDatabaseMigrationSqlVMInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal + { + /// Storage Account Key. + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + string AzureBlobStorageAccountResourceId { get; set; } + /// Backup configuration info. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupConfiguration BackupConfiguration { get; set; } + /// Source location of backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation BackupConfigurationSourceLocation { get; set; } + /// Target location for copying backups. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation BackupConfigurationTargetLocation { get; set; } + /// Database migration end time. + global::System.DateTime? EndedOn { get; set; } + /// Password for username to access file share location. + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + string FileShareUsername { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType? Kind { get; set; } + /// Error details in case of migration failure. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo MigrationFailureError { get; set; } + /// Error code. + string MigrationFailureErrorCode { get; set; } + /// Error message. + string MigrationFailureErrorMessage { get; set; } + /// ID tracking current migration operation. + string MigrationOperationId { get; set; } + /// Resource Id of the Migration Service. + string MigrationService { get; set; } + /// Migration status. + string MigrationStatus { get; set; } + /// Detailed migration status. Not included by default. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails MigrationStatusDetail { get; set; } + /// Offline configuration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration OfflineConfiguration { get; set; } + /// + /// 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. + /// + string OfflineConfigurationLastBackupName { get; set; } + /// Offline migration + bool? OfflineConfigurationOffline { get; set; } + /// Database Migration Resource properties for SQL Virtual Machine. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationPropertiesSqlVM Property { get; set; } + /// Error message for migration provisioning failure, if any. + string ProvisioningError { get; set; } + /// + /// Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration + /// has started. + /// + string ProvisioningState { get; set; } + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + string Scope { get; set; } + /// Name of the source database. + string SourceDatabaseName { get; set; } + /// Source Azure Blob. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob SourceLocationAzureBlob { get; set; } + /// Source File share. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare SourceLocationFileShare { get; set; } + /// Backup storage Type. + string SourceLocationFileStorageType { get; set; } + /// Name of the source sql server. + string SourceServerName { get; set; } + /// Source SQL Server connection details. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation SourceSqlConnection { get; set; } + /// Authentication type. + string SourceSqlConnectionAuthentication { get; set; } + /// Data source. + string SourceSqlConnectionDataSource { get; set; } + /// Whether to encrypt connection or not. + bool? SourceSqlConnectionEncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString SourceSqlConnectionPassword { get; set; } + /// Whether to trust server certificate or not. + bool? SourceSqlConnectionTrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string SourceSqlConnectionUserName { get; set; } + /// Database migration start time. + global::System.DateTime? StartedOn { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Database collation to be used for the target database. + string TargetDatabaseCollation { get; set; } + /// Storage Account Key. + string TargetLocationAccountKey { get; set; } + /// Resource Id of the storage account copying backups. + string TargetLocationStorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.json.cs new file mode 100644 index 000000000000..deb402c86590 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseMigrationSqlVM.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database Migration Resource for SQL Virtual Machine. + public partial class DatabaseMigrationSqlVM + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseMigrationSqlVM(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProxyResource(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationPropertiesSqlVM.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseMigrationSqlVM(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.PowerShell.cs new file mode 100644 index 000000000000..0043b5f7dfe6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A representation of the name of an object in a database + [System.ComponentModel.TypeConverter(typeof(DatabaseObjectNameTypeConverter))] + public partial class DatabaseObjectName + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseObjectName(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseObjectName(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseObjectName(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseObjectName(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A representation of the name of an object in a database + [System.ComponentModel.TypeConverter(typeof(DatabaseObjectNameTypeConverter))] + public partial interface IDatabaseObjectName + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.TypeConverter.cs new file mode 100644 index 000000000000..d20d3caa2927 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseObjectNameTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseObjectName.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseObjectName.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseObjectName.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.cs new file mode 100644 index 000000000000..aa413b74c7d1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A representation of the name of an object in a database + public partial class DatabaseObjectName : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal + { + + /// Backing field for property. + private string _databaseName; + + /// The unescaped name of the database containing the object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for ObjectName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal.ObjectName { get => this._objectName; set { {_objectName = value;} } } + + /// Internal Acessors for SchemaName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectNameInternal.SchemaName { get => this._schemaName; set { {_schemaName = value;} } } + + /// Backing field for property. + private string _objectName; + + /// The unescaped name of the object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ObjectName { get => this._objectName; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? _objectType; + + /// Type of the object in the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Backing field for property. + private string _schemaName; + + /// The unescaped name of the schema containing the object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SchemaName { get => this._schemaName; } + + /// Creates an new instance. + public DatabaseObjectName() + { + + } + } + /// A representation of the name of an object in a database + public partial interface IDatabaseObjectName : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The unescaped name of the database containing the object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unescaped name of the database containing the object", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// The unescaped name of the object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unescaped name of the object", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string ObjectName { get; } + /// Type of the object in the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the object in the database", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? ObjectType { get; set; } + /// The unescaped name of the schema containing the object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unescaped name of the schema containing the object", + SerializedName = @"schemaName", + PossibleTypes = new [] { typeof(string) })] + string SchemaName { get; } + + } + /// A representation of the name of an object in a database + internal partial interface IDatabaseObjectNameInternal + + { + /// The unescaped name of the database containing the object + string DatabaseName { get; set; } + /// The unescaped name of the object + string ObjectName { get; set; } + /// Type of the object in the database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? ObjectType { get; set; } + /// The unescaped name of the schema containing the object + string SchemaName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.json.cs new file mode 100644 index 000000000000..01c9ae1aa6cb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseObjectName.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A representation of the name of an object in a database + public partial class DatabaseObjectName + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseObjectName(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_objectName = If( json?.PropertyT("objectName"), out var __jsonObjectName) ? (string)__jsonObjectName : (string)ObjectName;} + {_schemaName = If( json?.PropertyT("schemaName"), out var __jsonSchemaName) ? (string)__jsonSchemaName : (string)SchemaName;} + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseObjectName FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseObjectName(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectName.ToString()) : null, "objectName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._schemaName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._schemaName.ToString()) : null, "schemaName" ,container.Add ); + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.PowerShell.cs new file mode 100644 index 000000000000..8115f245928f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.PowerShell.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Summary of database results in the migration + [System.ComponentModel.TypeConverter(typeof(DatabaseSummaryResultTypeConverter))] + public partial class DatabaseSummaryResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseSummaryResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResultInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResultInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseSummaryResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResultInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResultInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)this).ResultPrefix, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseSummaryResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseSummaryResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Summary of database results in the migration + [System.ComponentModel.TypeConverter(typeof(DatabaseSummaryResultTypeConverter))] + public partial interface IDatabaseSummaryResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.TypeConverter.cs new file mode 100644 index 000000000000..fd6bf6455f20 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseSummaryResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseSummaryResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseSummaryResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseSummaryResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.cs new file mode 100644 index 000000000000..76510718d647 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Summary of database results in the migration + public partial class DatabaseSummaryResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult __dataItemMigrationSummaryResult = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataItemMigrationSummaryResult(); + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).EndedOn; } + + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ErrorPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ErrorPrefix; } + + /// Number of successfully completed items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long? ItemsCompletedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ItemsCompletedCount; } + + /// Number of items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long? ItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ItemsCount; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).EndedOn = value; } + + /// Internal Acessors for ErrorPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ErrorPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ErrorPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ErrorPrefix = value; } + + /// Internal Acessors for ItemsCompletedCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ItemsCompletedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ItemsCompletedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ItemsCompletedCount = value; } + + /// Internal Acessors for ItemsCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ItemsCount = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).Name = value; } + + /// Internal Acessors for ResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.ResultPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ResultPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ResultPrefix = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).StartedOn = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).State = value; } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal.StatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).StatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).StatusMessage = value; } + + /// Internal Acessors for SizeMb + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResultInternal.SizeMb { get => this._sizeMb; set { {_sizeMb = value;} } } + + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).Name; } + + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).ResultPrefix; } + + /// Backing field for property. + private double? _sizeMb; + + /// Size of the database in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? SizeMb { get => this._sizeMb; } + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).StartedOn; } + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).State; } + + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string StatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal)__dataItemMigrationSummaryResult).StatusMessage; } + + /// Creates an new instance. + public DatabaseSummaryResult() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__dataItemMigrationSummaryResult), __dataItemMigrationSummaryResult); + await eventListener.AssertObjectIsValid(nameof(__dataItemMigrationSummaryResult), __dataItemMigrationSummaryResult); + } + } + /// Summary of database results in the migration + public partial interface IDatabaseSummaryResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResult + { + /// Size of the database in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Size of the database in megabytes", + SerializedName = @"sizeMB", + PossibleTypes = new [] { typeof(double) })] + double? SizeMb { get; } + + } + /// Summary of database results in the migration + internal partial interface IDatabaseSummaryResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataItemMigrationSummaryResultInternal + { + /// Size of the database in megabytes + double? SizeMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.json.cs new file mode 100644 index 000000000000..3b02cc504777 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseSummaryResult.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Summary of database results in the migration + public partial class DatabaseSummaryResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseSummaryResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __dataItemMigrationSummaryResult = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataItemMigrationSummaryResult(json); + {_sizeMb = If( json?.PropertyT("sizeMB"), out var __jsonSizeMb) ? (double?)__jsonSizeMb : SizeMb;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseSummaryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseSummaryResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __dataItemMigrationSummaryResult?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sizeMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._sizeMb) : null, "sizeMB" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.PowerShell.cs new file mode 100644 index 000000000000..3b09047c67a0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Table properties + [System.ComponentModel.TypeConverter(typeof(DatabaseTableTypeConverter))] + public partial class DatabaseTable + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatabaseTable(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HasRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).HasRow = (bool?) content.GetValueForProperty("HasRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).HasRow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatabaseTable(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HasRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).HasRow = (bool?) content.GetValueForProperty("HasRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).HasRow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatabaseTable(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatabaseTable(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Table properties + [System.ComponentModel.TypeConverter(typeof(DatabaseTableTypeConverter))] + public partial interface IDatabaseTable + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.TypeConverter.cs new file mode 100644 index 000000000000..1c312d319409 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DatabaseTableTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DatabaseTable.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DatabaseTable.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DatabaseTable.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.cs new file mode 100644 index 000000000000..e93fd9593439 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Table properties + public partial class DatabaseTable : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal + { + + /// Backing field for property. + private bool? _hasRow; + + /// Indicates whether table is empty or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? HasRow { get => this._hasRow; } + + /// Internal Acessors for HasRow + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal.HasRow { get => this._hasRow; set { {_hasRow = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTableInternal.Name { get => this._name; set { {_name = value;} } } + + /// Backing field for property. + private string _name; + + /// Schema-qualified name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Creates an new instance. + public DatabaseTable() + { + + } + } + /// Table properties + public partial interface IDatabaseTable : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Indicates whether table is empty or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates whether table is empty or not", + SerializedName = @"hasRows", + PossibleTypes = new [] { typeof(bool) })] + bool? HasRow { get; } + /// Schema-qualified name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Schema-qualified name of the table", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + } + /// Table properties + internal partial interface IDatabaseTableInternal + + { + /// Indicates whether table is empty or not + bool? HasRow { get; set; } + /// Schema-qualified name of the table + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.json.cs new file mode 100644 index 000000000000..65d5e13b2486 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DatabaseTable.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Table properties + public partial class DatabaseTable + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DatabaseTable(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_hasRow = If( json?.PropertyT("hasRows"), out var __jsonHasRows) ? (bool?)__jsonHasRows : HasRow;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DatabaseTable(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._hasRow ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._hasRow) : null, "hasRows" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.PowerShell.cs new file mode 100644 index 000000000000..86d94fd97af5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Details of node to be deleted. + [System.ComponentModel.TypeConverter(typeof(DeleteNodeTypeConverter))] + public partial class DeleteNode + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeleteNode(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).NodeName, global::System.Convert.ToString); + } + if (content.Contains("IntegrationRuntimeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).IntegrationRuntimeName = (string) content.GetValueForProperty("IntegrationRuntimeName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).IntegrationRuntimeName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeleteNode(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).NodeName, global::System.Convert.ToString); + } + if (content.Contains("IntegrationRuntimeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).IntegrationRuntimeName = (string) content.GetValueForProperty("IntegrationRuntimeName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal)this).IntegrationRuntimeName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeleteNode(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeleteNode(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details of node to be deleted. + [System.ComponentModel.TypeConverter(typeof(DeleteNodeTypeConverter))] + public partial interface IDeleteNode + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.TypeConverter.cs new file mode 100644 index 000000000000..b6d1e81f2988 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeleteNodeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeleteNode.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeleteNode.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeleteNode.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.cs new file mode 100644 index 000000000000..16207aa2cc78 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Details of node to be deleted. + public partial class DeleteNode : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNodeInternal + { + + /// Backing field for property. + private string _integrationRuntimeName; + + /// The name of integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string IntegrationRuntimeName { get => this._integrationRuntimeName; set => this._integrationRuntimeName = value; } + + /// Backing field for property. + private string _nodeName; + + /// The name of node to delete. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NodeName { get => this._nodeName; set => this._nodeName = value; } + + /// Creates an new instance. + public DeleteNode() + { + + } + } + /// Details of node to be deleted. + public partial interface IDeleteNode : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The name of integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of integration runtime.", + SerializedName = @"integrationRuntimeName", + PossibleTypes = new [] { typeof(string) })] + string IntegrationRuntimeName { get; set; } + /// The name of node to delete. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of node to delete.", + SerializedName = @"nodeName", + PossibleTypes = new [] { typeof(string) })] + string NodeName { get; set; } + + } + /// Details of node to be deleted. + internal partial interface IDeleteNodeInternal + + { + /// The name of integration runtime. + string IntegrationRuntimeName { get; set; } + /// The name of node to delete. + string NodeName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.json.cs new file mode 100644 index 000000000000..8c9db8ebf5a8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/DeleteNode.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Details of node to be deleted. + public partial class DeleteNode + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DeleteNode(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_nodeName = If( json?.PropertyT("nodeName"), out var __jsonNodeName) ? (string)__jsonNodeName : (string)NodeName;} + {_integrationRuntimeName = If( json?.PropertyT("integrationRuntimeName"), out var __jsonIntegrationRuntimeName) ? (string)__jsonIntegrationRuntimeName : (string)IntegrationRuntimeName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DeleteNode(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._nodeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nodeName.ToString()) : null, "nodeName" ,container.Add ); + AddIf( null != (((object)this._integrationRuntimeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._integrationRuntimeName.ToString()) : null, "integrationRuntimeName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.PowerShell.cs new file mode 100644 index 000000000000..a4a3ad1bba2c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Error details + [System.ComponentModel.TypeConverter(typeof(ErrorInfoTypeConverter))] + public partial class ErrorInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error details + [System.ComponentModel.TypeConverter(typeof(ErrorInfoTypeConverter))] + public partial interface IErrorInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.TypeConverter.cs new file mode 100644 index 000000000000..3da19cdb3ae7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.cs new file mode 100644 index 000000000000..ec9d63d53b03 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Error details + public partial class ErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfoInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public ErrorInfo() + { + + } + } + /// Error details + public partial interface IErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// Error details + internal partial interface IErrorInfoInternal + + { + /// Error code. + string Code { get; set; } + /// Error message. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.json.cs new file mode 100644 index 000000000000..6afd6fe03cf1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ErrorInfo.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Error details + public partial class ErrorInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ErrorInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.PowerShell.cs new file mode 100644 index 000000000000..dda4a0f333ff --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Description about the errors happen while performing migration validation + [System.ComponentModel.TypeConverter(typeof(ExecutionStatisticsTypeConverter))] + public partial class ExecutionStatistics + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExecutionStatistics(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExecutionStatistics(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExecutionStatistics(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ExecutionCount = (long?) content.GetValueForProperty("ExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).CpuTimeMS = (float?) content.GetValueForProperty("CpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).CpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ElapsedTimeMS = (float?) content.GetValueForProperty("ElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("WaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).WaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("WaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).WaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("HasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).HasError = (bool?) content.GetValueForProperty("HasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).HasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).SqlError = (string[]) content.GetValueForProperty("SqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).SqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExecutionStatistics(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ExecutionCount = (long?) content.GetValueForProperty("ExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).CpuTimeMS = (float?) content.GetValueForProperty("CpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).CpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ElapsedTimeMS = (float?) content.GetValueForProperty("ElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).ElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("WaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).WaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("WaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).WaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("HasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).HasError = (bool?) content.GetValueForProperty("HasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).HasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).SqlError = (string[]) content.GetValueForProperty("SqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)this).SqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Description about the errors happen while performing migration validation + [System.ComponentModel.TypeConverter(typeof(ExecutionStatisticsTypeConverter))] + public partial interface IExecutionStatistics + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.TypeConverter.cs new file mode 100644 index 000000000000..829716ca3446 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExecutionStatisticsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExecutionStatistics.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExecutionStatistics.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExecutionStatistics.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.cs new file mode 100644 index 000000000000..15b8ad6defa4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description about the errors happen while performing migration validation + public partial class ExecutionStatistics : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal + { + + /// Backing field for property. + private float? _cpuTimeMS; + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public float? CpuTimeMS { get => this._cpuTimeMS; set => this._cpuTimeMS = value; } + + /// Backing field for property. + private float? _elapsedTimeMS; + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public float? ElapsedTimeMS { get => this._elapsedTimeMS; set => this._elapsedTimeMS = value; } + + /// Backing field for property. + private long? _executionCount; + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ExecutionCount { get => this._executionCount; set => this._executionCount = value; } + + /// Backing field for property. + private bool? _hasError; + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? HasError { get => this._hasError; set => this._hasError = value; } + + /// Backing field for property. + private string[] _sqlError; + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SqlError { get => this._sqlError; set => this._sqlError = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats _waitStat; + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats WaitStat { get => (this._waitStat = this._waitStat ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStats()); set => this._waitStat = value; } + + /// Creates an new instance. + public ExecutionStatistics() + { + + } + } + /// Description about the errors happen while performing migration validation + public partial interface IExecutionStatistics : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CPU Time in millisecond(s) for the query execution", + SerializedName = @"cpuTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? CpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken in millisecond(s) for executing the query", + SerializedName = @"elapsedTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? ElapsedTimeMS { get; set; } + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"No. of query executions", + SerializedName = @"executionCount", + PossibleTypes = new [] { typeof(long) })] + long? ExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the query resulted in an error", + SerializedName = @"hasErrors", + PossibleTypes = new [] { typeof(bool) })] + bool? HasError { get; set; } + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sql Errors", + SerializedName = @"sqlErrors", + PossibleTypes = new [] { typeof(string) })] + string[] SqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of sql query execution wait types and the respective statistics", + SerializedName = @"waitStats", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats WaitStat { get; set; } + + } + /// Description about the errors happen while performing migration validation + internal partial interface IExecutionStatisticsInternal + + { + /// CPU Time in millisecond(s) for the query execution + float? CpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + float? ElapsedTimeMS { get; set; } + /// No. of query executions + long? ExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + bool? HasError { get; set; } + /// List of sql Errors + string[] SqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats WaitStat { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.json.cs new file mode 100644 index 000000000000..7b8d2ddc8770 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatistics.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description about the errors happen while performing migration validation + public partial class ExecutionStatistics + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ExecutionStatistics(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_executionCount = If( json?.PropertyT("executionCount"), out var __jsonExecutionCount) ? (long?)__jsonExecutionCount : ExecutionCount;} + {_cpuTimeMS = If( json?.PropertyT("cpuTimeMs"), out var __jsonCpuTimeMS) ? (float?)__jsonCpuTimeMS : CpuTimeMS;} + {_elapsedTimeMS = If( json?.PropertyT("elapsedTimeMs"), out var __jsonElapsedTimeMS) ? (float?)__jsonElapsedTimeMS : ElapsedTimeMS;} + {_waitStat = If( json?.PropertyT("waitStats"), out var __jsonWaitStats) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStats.FromJson(__jsonWaitStats) : WaitStat;} + {_hasError = If( json?.PropertyT("hasErrors"), out var __jsonHasErrors) ? (bool?)__jsonHasErrors : HasError;} + {_sqlError = If( json?.PropertyT("sqlErrors"), out var __jsonSqlErrors) ? If( __jsonSqlErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SqlError;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ExecutionStatistics(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._executionCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._executionCount) : null, "executionCount" ,container.Add ); + AddIf( null != this._cpuTimeMS ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((float)this._cpuTimeMS) : null, "cpuTimeMs" ,container.Add ); + AddIf( null != this._elapsedTimeMS ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((float)this._elapsedTimeMS) : null, "elapsedTimeMs" ,container.Add ); + AddIf( null != this._waitStat ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._waitStat.ToJson(null,serializationMode) : null, "waitStats" ,container.Add ); + AddIf( null != this._hasError ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._hasError) : null, "hasErrors" ,container.Add ); + if (null != this._sqlError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._sqlError ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("sqlErrors",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.PowerShell.cs new file mode 100644 index 000000000000..377f134e21b5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Dictionary of sql query execution wait types and the respective statistics + [System.ComponentModel.TypeConverter(typeof(ExecutionStatisticsWaitStatsTypeConverter))] + public partial class ExecutionStatisticsWaitStats + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExecutionStatisticsWaitStats(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExecutionStatisticsWaitStats(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExecutionStatisticsWaitStats(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExecutionStatisticsWaitStats(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dictionary of sql query execution wait types and the respective statistics + [System.ComponentModel.TypeConverter(typeof(ExecutionStatisticsWaitStatsTypeConverter))] + public partial interface IExecutionStatisticsWaitStats + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.TypeConverter.cs new file mode 100644 index 000000000000..92fa19ae0696 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExecutionStatisticsWaitStatsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExecutionStatisticsWaitStats.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExecutionStatisticsWaitStats.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExecutionStatisticsWaitStats.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.cs new file mode 100644 index 000000000000..f922ff3c6af4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of sql query execution wait types and the respective statistics + public partial class ExecutionStatisticsWaitStats : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStatsInternal + { + + /// Creates an new instance. + public ExecutionStatisticsWaitStats() + { + + } + } + /// Dictionary of sql query execution wait types and the respective statistics + public partial interface IExecutionStatisticsWaitStats : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Dictionary of sql query execution wait types and the respective statistics + internal partial interface IExecutionStatisticsWaitStatsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.dictionary.cs new file mode 100644 index 000000000000..4ec640132128 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class ExecutionStatisticsWaitStats : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStats source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.json.cs new file mode 100644 index 000000000000..b52f1c2812a5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ExecutionStatisticsWaitStats.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of sql query execution wait types and the respective statistics + public partial class ExecutionStatisticsWaitStats + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ExecutionStatisticsWaitStats(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.WaitStatistics.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ExecutionStatisticsWaitStats(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.PowerShell.cs new file mode 100644 index 000000000000..62aef9067269 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// OData page of files + [System.ComponentModel.TypeConverter(typeof(FileListTypeConverter))] + public partial class FileList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileList(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFileTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFileTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OData page of files + [System.ComponentModel.TypeConverter(typeof(FileListTypeConverter))] + public partial interface IFileList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.TypeConverter.cs new file mode 100644 index 000000000000..8c7baec023fe --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.cs new file mode 100644 index 000000000000..598606e24824 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of files + public partial class FileList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to load the next page of files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile[] _value; + + /// List of files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public FileList() + { + + } + } + /// OData page of files + public partial interface IFileList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// URL to load the next page of files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to load the next page of files", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of files", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile[] Value { get; set; } + + } + /// OData page of files + internal partial interface IFileListInternal + + { + /// URL to load the next page of files + string NextLink { get; set; } + /// List of files + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.json.cs new file mode 100644 index 000000000000..cacd2894fc38 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of files + public partial class FileList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal FileList(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new FileList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.PowerShell.cs new file mode 100644 index 000000000000..73705dca5f94 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// File share information with Path, Username, and Password. + [System.ComponentModel.TypeConverter(typeof(FileShareTypeConverter))] + public partial class FileShare + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShare(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShare(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShare(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Password, global::System.Convert.ToString); + } + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Path, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShare(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Password, global::System.Convert.ToString); + } + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)this).Path, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// File share information with Path, Username, and Password. + [System.ComponentModel.TypeConverter(typeof(FileShareTypeConverter))] + public partial interface IFileShare + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.TypeConverter.cs new file mode 100644 index 000000000000..a90096ace7ee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileShareTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShare.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShare.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShare.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.cs new file mode 100644 index 000000000000..dafa3c098bb5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// File share information with Path, Username, and Password. + public partial class FileShare : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal + { + + /// Backing field for property. + private string _password; + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Password { get => this._password; set => this._password = value; } + + /// Backing field for property. + private string _path; + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Backing field for property. + private string _userName; + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string UserName { get => this._userName; set => this._userName = value; } + + /// Creates an new instance. + public FileShare() + { + + } + } + /// File share information with Path, Username, and Password. + public partial interface IFileShare : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string UserName { get; set; } + + } + /// File share information with Path, Username, and Password. + internal partial interface IFileShareInternal + + { + /// Password credential used to connect to the share location. + string Password { get; set; } + /// The folder path for this share. + string Path { get; set; } + /// User name credential to connect to the share location + string UserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.json.cs new file mode 100644 index 000000000000..23742c6eb0e3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileShare.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// File share information with Path, Username, and Password. + public partial class FileShare + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal FileShare(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)UserName;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new FileShare(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.PowerShell.cs new file mode 100644 index 000000000000..cd95559f7c8e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// File storage information. + [System.ComponentModel.TypeConverter(typeof(FileStorageInfoTypeConverter))] + public partial class FileStorageInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileStorageInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileStorageInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileStorageInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Uri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Uri = (string) content.GetValueForProperty("Uri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Uri, global::System.Convert.ToString); + } + if (content.Contains("Header")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Header = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Header, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfoHeadersTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileStorageInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Uri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Uri = (string) content.GetValueForProperty("Uri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Uri, global::System.Convert.ToString); + } + if (content.Contains("Header")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Header = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal)this).Header, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfoHeadersTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// File storage information. + [System.ComponentModel.TypeConverter(typeof(FileStorageInfoTypeConverter))] + public partial interface IFileStorageInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.TypeConverter.cs new file mode 100644 index 000000000000..d472e7da79a4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileStorageInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileStorageInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileStorageInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileStorageInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.cs new file mode 100644 index 000000000000..6e9aa54faaf6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// File storage information. + public partial class FileStorageInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders _header; + + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders Header { get => (this._header = this._header ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfoHeaders()); set => this._header = value; } + + /// Backing field for property. + private string _uri; + + /// A URI that can be used to access the file content. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Uri { get => this._uri; set => this._uri = value; } + + /// Creates an new instance. + public FileStorageInfo() + { + + } + } + /// File storage information. + public partial interface IFileStorageInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders Header { get; set; } + /// A URI that can be used to access the file content. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A URI that can be used to access the file content.", + SerializedName = @"uri", + PossibleTypes = new [] { typeof(string) })] + string Uri { get; set; } + + } + /// File storage information. + internal partial interface IFileStorageInfoInternal + + { + /// Dictionary of + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders Header { get; set; } + /// A URI that can be used to access the file content. + string Uri { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.json.cs new file mode 100644 index 000000000000..836eeb11f198 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfo.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// File storage information. + public partial class FileStorageInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal FileStorageInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_uri = If( json?.PropertyT("uri"), out var __jsonUri) ? (string)__jsonUri : (string)Uri;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfoHeaders.FromJson(__jsonHeaders) : Header;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new FileStorageInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._uri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._uri.ToString()) : null, "uri" ,container.Add ); + AddIf( null != this._header ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._header.ToJson(null,serializationMode) : null, "headers" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.PowerShell.cs new file mode 100644 index 000000000000..65c5b2bb6987 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(FileStorageInfoHeadersTypeConverter))] + public partial class FileStorageInfoHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileStorageInfoHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileStorageInfoHeaders(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileStorageInfoHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileStorageInfoHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(FileStorageInfoHeadersTypeConverter))] + public partial interface IFileStorageInfoHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.TypeConverter.cs new file mode 100644 index 000000000000..7402af2d0b70 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileStorageInfoHeadersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileStorageInfoHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileStorageInfoHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileStorageInfoHeaders.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.cs new file mode 100644 index 000000000000..f991bcf0dbea --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class FileStorageInfoHeaders : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeadersInternal + { + + /// Creates an new instance. + public FileStorageInfoHeaders() + { + + } + } + /// Dictionary of + public partial interface IFileStorageInfoHeaders : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Dictionary of + internal partial interface IFileStorageInfoHeadersInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.dictionary.cs new file mode 100644 index 000000000000..d0dcd4a6a418 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class FileStorageInfoHeaders : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileStorageInfoHeaders source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.json.cs new file mode 100644 index 000000000000..e15b7ece9a25 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/FileStorageInfoHeaders.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class FileStorageInfoHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal FileStorageInfoHeaders(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfoHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new FileStorageInfoHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.PowerShell.cs new file mode 100644 index 000000000000..8adcfc3b6b40 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the task that reads configuration from project artifacts + [System.ComponentModel.TypeConverter(typeof(GetProjectDetailsNonSqlTaskInputTypeConverter))] + public partial class GetProjectDetailsNonSqlTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetProjectDetailsNonSqlTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetProjectDetailsNonSqlTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetProjectDetailsNonSqlTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("ProjectLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectLocation = (string) content.GetValueForProperty("ProjectLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectLocation, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetProjectDetailsNonSqlTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("ProjectLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectLocation = (string) content.GetValueForProperty("ProjectLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal)this).ProjectLocation, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that reads configuration from project artifacts + [System.ComponentModel.TypeConverter(typeof(GetProjectDetailsNonSqlTaskInputTypeConverter))] + public partial interface IGetProjectDetailsNonSqlTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..3ecc383c491f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetProjectDetailsNonSqlTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetProjectDetailsNonSqlTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetProjectDetailsNonSqlTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetProjectDetailsNonSqlTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.cs new file mode 100644 index 000000000000..7a96f6254616 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that reads configuration from project artifacts + public partial class GetProjectDetailsNonSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInputInternal + { + + /// Backing field for property. + private string _projectLocation; + + /// A URL that points to the location to access project artifacts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProjectLocation { get => this._projectLocation; set => this._projectLocation = value; } + + /// Backing field for property. + private string _projectName; + + /// Name of the migration project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// Creates an new instance. + public GetProjectDetailsNonSqlTaskInput() + { + + } + } + /// Input for the task that reads configuration from project artifacts + public partial interface IGetProjectDetailsNonSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// A URL that points to the location to access project artifacts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A URL that points to the location to access project artifacts", + SerializedName = @"projectLocation", + PossibleTypes = new [] { typeof(string) })] + string ProjectLocation { get; set; } + /// Name of the migration project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the migration project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + string ProjectName { get; set; } + + } + /// Input for the task that reads configuration from project artifacts + internal partial interface IGetProjectDetailsNonSqlTaskInputInternal + + { + /// A URL that points to the location to access project artifacts + string ProjectLocation { get; set; } + /// Name of the migration project + string ProjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.json.cs new file mode 100644 index 000000000000..8777b9800f82 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetProjectDetailsNonSqlTaskInput.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that reads configuration from project artifacts + public partial class GetProjectDetailsNonSqlTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetProjectDetailsNonSqlTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetProjectDetailsNonSqlTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetProjectDetailsNonSqlTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_projectName = If( json?.PropertyT("projectName"), out var __jsonProjectName) ? (string)__jsonProjectName : (string)ProjectName;} + {_projectLocation = If( json?.PropertyT("projectLocation"), out var __jsonProjectLocation) ? (string)__jsonProjectLocation : (string)ProjectLocation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._projectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._projectName.ToString()) : null, "projectName" ,container.Add ); + AddIf( null != (((object)this._projectLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._projectLocation.ToString()) : null, "projectLocation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.PowerShell.cs new file mode 100644 index 000000000000..6995200125ae --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.PowerShell.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the task that gets TDE certificates in Base64 encoded format. + [System.ComponentModel.TypeConverter(typeof(GetTdeCertificatesSqlTaskInputTypeConverter))] + public partial class GetTdeCertificatesSqlTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetTdeCertificatesSqlTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetTdeCertificatesSqlTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetTdeCertificatesSqlTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).SelectedCertificate = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[]) content.GetValueForProperty("SelectedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).SelectedCertificate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SelectedCertificateInputTypeConverter.ConvertFrom)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetTdeCertificatesSqlTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).SelectedCertificate = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[]) content.GetValueForProperty("SelectedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).SelectedCertificate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SelectedCertificateInputTypeConverter.ConvertFrom)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that gets TDE certificates in Base64 encoded format. + [System.ComponentModel.TypeConverter(typeof(GetTdeCertificatesSqlTaskInputTypeConverter))] + public partial interface IGetTdeCertificatesSqlTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..ff91a4d2cd21 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetTdeCertificatesSqlTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetTdeCertificatesSqlTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetTdeCertificatesSqlTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetTdeCertificatesSqlTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.cs new file mode 100644 index 000000000000..4a0b1404ce17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.cs @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that gets TDE certificates in Base64 encoded format. + public partial class GetTdeCertificatesSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare _backupFileShare; + + /// + /// Backup file share information for file share to be used for temporarily storing files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set => this._backupFileShare = value; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path = value ; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _connectionInfo; + + /// Connection information for SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._connectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName = value ?? null; } + + /// Internal Acessors for BackupFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal.BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set { {_backupFileShare = value;} } } + + /// Internal Acessors for ConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal.ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_connectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[] _selectedCertificate; + + /// + /// List containing certificate names and corresponding password to use for encrypting the exported certificate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[] SelectedCertificate { get => this._selectedCertificate; set => this._selectedCertificate = value; } + + /// Creates an new instance. + public GetTdeCertificatesSqlTaskInput() + { + + } + } + /// Input for the task that gets TDE certificates in Base64 encoded format. + public partial interface IGetTdeCertificatesSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string BackupFileShareUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// + /// List containing certificate names and corresponding password to use for encrypting the exported certificate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List containing certificate names and corresponding password to use for encrypting the exported certificate.", + SerializedName = @"selectedCertificates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[] SelectedCertificate { get; set; } + + } + /// Input for the task that gets TDE certificates in Base64 encoded format. + internal partial interface IGetTdeCertificatesSqlTaskInputInternal + + { + /// + /// Backup file share information for file share to be used for temporarily storing files. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get; set; } + /// Password credential used to connect to the share location. + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + string BackupFileShareUserName { get; set; } + /// Connection information for SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo ConnectionInfo { get; set; } + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string ConnectionInfoResourceId { get; set; } + /// server brand version + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// + /// List containing certificate names and corresponding password to use for encrypting the exported certificate. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[] SelectedCertificate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.json.cs new file mode 100644 index 000000000000..629e06e1ed43 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskInput.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that gets TDE certificates in Base64 encoded format. + public partial class GetTdeCertificatesSqlTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetTdeCertificatesSqlTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetTdeCertificatesSqlTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_connectionInfo = If( json?.PropertyT("connectionInfo"), out var __jsonConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonConnectionInfo) : ConnectionInfo;} + {_backupFileShare = If( json?.PropertyT("backupFileShare"), out var __jsonBackupFileShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare.FromJson(__jsonBackupFileShare) : BackupFileShare;} + {_selectedCertificate = If( json?.PropertyT("selectedCertificates"), out var __jsonSelectedCertificates) ? If( __jsonSelectedCertificates as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SelectedCertificateInput.FromJson(__u) )) ))() : null : SelectedCertificate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._connectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._connectionInfo.ToJson(null,serializationMode) : null, "connectionInfo" ,container.Add ); + AddIf( null != this._backupFileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupFileShare.ToJson(null,serializationMode) : null, "backupFileShare" ,container.Add ); + if (null != this._selectedCertificate) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedCertificate ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedCertificates",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..e4300d070b2e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output of the task that gets TDE certificates in Base64 encoded format. + [System.ComponentModel.TypeConverter(typeof(GetTdeCertificatesSqlTaskOutputTypeConverter))] + public partial class GetTdeCertificatesSqlTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetTdeCertificatesSqlTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetTdeCertificatesSqlTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetTdeCertificatesSqlTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Base64EncodedCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).Base64EncodedCertificate = (string) content.GetValueForProperty("Base64EncodedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).Base64EncodedCertificate, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetTdeCertificatesSqlTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Base64EncodedCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).Base64EncodedCertificate = (string) content.GetValueForProperty("Base64EncodedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).Base64EncodedCertificate, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output of the task that gets TDE certificates in Base64 encoded format. + [System.ComponentModel.TypeConverter(typeof(GetTdeCertificatesSqlTaskOutputTypeConverter))] + public partial interface IGetTdeCertificatesSqlTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..289e63dce55f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetTdeCertificatesSqlTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetTdeCertificatesSqlTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetTdeCertificatesSqlTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetTdeCertificatesSqlTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.cs new file mode 100644 index 000000000000..7484488138fb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that gets TDE certificates in Base64 encoded format. + public partial class GetTdeCertificatesSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal + { + + /// Backing field for property. + private string _base64EncodedCertificate; + + /// Mapping from certificate name to base 64 encoded format. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Base64EncodedCertificate { get => this._base64EncodedCertificate; } + + /// Internal Acessors for Base64EncodedCertificate + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal.Base64EncodedCertificate { get => this._base64EncodedCertificate; set { {_base64EncodedCertificate = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public GetTdeCertificatesSqlTaskOutput() + { + + } + } + /// Output of the task that gets TDE certificates in Base64 encoded format. + public partial interface IGetTdeCertificatesSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Mapping from certificate name to base 64 encoded format. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mapping from certificate name to base 64 encoded format.", + SerializedName = @"base64EncodedCertificates", + PossibleTypes = new [] { typeof(string) })] + string Base64EncodedCertificate { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output of the task that gets TDE certificates in Base64 encoded format. + internal partial interface IGetTdeCertificatesSqlTaskOutputInternal + + { + /// Mapping from certificate name to base 64 encoded format. + string Base64EncodedCertificate { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.json.cs new file mode 100644 index 000000000000..2794e9deeb05 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskOutput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that gets TDE certificates in Base64 encoded format. + public partial class GetTdeCertificatesSqlTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetTdeCertificatesSqlTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetTdeCertificatesSqlTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_base64EncodedCertificate = If( json?.PropertyT("base64EncodedCertificates"), out var __jsonBase64EncodedCertificates) ? (string)__jsonBase64EncodedCertificates : (string)Base64EncodedCertificate;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._base64EncodedCertificate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._base64EncodedCertificate.ToString()) : null, "base64EncodedCertificates" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..e3cb547b2805 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.PowerShell.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that gets TDE certificates in Base64 encoded format. + [System.ComponentModel.TypeConverter(typeof(GetTdeCertificatesSqlTaskPropertiesTypeConverter))] + public partial class GetTdeCertificatesSqlTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetTdeCertificatesSqlTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetTdeCertificatesSqlTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetTdeCertificatesSqlTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputBackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputBackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("InputBackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputBackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputSelectedCertificate = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[]) content.GetValueForProperty("InputSelectedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputSelectedCertificate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SelectedCertificateInputTypeConverter.ConvertFrom)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetTdeCertificatesSqlTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputBackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputBackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("InputBackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputBackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputSelectedCertificate = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[]) content.GetValueForProperty("InputSelectedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).InputSelectedCertificate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SelectedCertificateInputTypeConverter.ConvertFrom)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that gets TDE certificates in Base64 encoded format. + [System.ComponentModel.TypeConverter(typeof(GetTdeCertificatesSqlTaskPropertiesTypeConverter))] + public partial interface IGetTdeCertificatesSqlTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..3ca6799d4f97 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetTdeCertificatesSqlTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetTdeCertificatesSqlTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetTdeCertificatesSqlTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetTdeCertificatesSqlTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.cs new file mode 100644 index 000000000000..dd2e46eb4fd3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that gets TDE certificates in Base64 encoded format. + public partial class GetTdeCertificatesSqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileSharePassword = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileSharePath = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileShareUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileShareUserName = value ?? null; } + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfoUserName = value ?? null; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskInput()); set => this._input = value; } + + /// + /// List containing certificate names and corresponding password to use for encrypting the exported certificate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[] InputSelectedCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).SelectedCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).SelectedCertificate = value ?? null /* arrayOf */; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputBackupFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal.InputBackupFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).BackupFileShare = value; } + + /// Internal Acessors for InputConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal.InputConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInputInternal)Input).ConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public GetTdeCertificatesSqlTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that gets TDE certificates in Base64 encoded format. + public partial interface IGetTdeCertificatesSqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string BackupFileShareUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// + /// List containing certificate names and corresponding password to use for encrypting the exported certificate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List containing certificate names and corresponding password to use for encrypting the exported certificate.", + SerializedName = @"selectedCertificates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[] InputSelectedCertificate { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput[] Output { get; } + + } + /// Properties for the task that gets TDE certificates in Base64 encoded format. + internal partial interface IGetTdeCertificatesSqlTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Password credential used to connect to the share location. + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + string BackupFileShareUserName { get; set; } + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string ConnectionInfoResourceId { get; set; } + /// server brand version + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskInput Input { get; set; } + /// + /// Backup file share information for file share to be used for temporarily storing files. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare InputBackupFileShare { get; set; } + /// Connection information for SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo InputConnectionInfo { get; set; } + /// + /// List containing certificate names and corresponding password to use for encrypting the exported certificate. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput[] InputSelectedCertificate { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.json.cs new file mode 100644 index 000000000000..72827750cc45 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetTdeCertificatesSqlTaskProperties.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that gets TDE certificates in Base64 encoded format. + public partial class GetTdeCertificatesSqlTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetTdeCertificatesSqlTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetTdeCertificatesSqlTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetTdeCertificatesSqlTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetTdeCertificatesSqlTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.PowerShell.cs new file mode 100644 index 000000000000..b956cb4619b9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesMySqlTaskInputTypeConverter))] + public partial class GetUserTablesMySqlTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesMySqlTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesMySqlTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesMySqlTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).SelectedDatabase = (string[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesMySqlTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).SelectedDatabase = (string[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesMySqlTaskInputTypeConverter))] + public partial interface IGetUserTablesMySqlTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..bdf52ce02779 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesMySqlTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesMySqlTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesMySqlTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesMySqlTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.cs new file mode 100644 index 000000000000..13ff1050f015 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that collects user tables for the given list of databases + public partial class GetUserTablesMySqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _connectionInfo; + + /// Connection information for SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._connectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)ConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName = value ?? null; } + + /// Internal Acessors for ConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal.ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_connectionInfo = value;} } } + + /// Backing field for property. + private string[] _selectedDatabase; + + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Creates an new instance. + public GetUserTablesMySqlTaskInput() + { + + } + } + /// Input for the task that collects user tables for the given list of databases + public partial interface IGetUserTablesMySqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int ConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of database names to collect tables for", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedDatabase { get; set; } + + } + /// Input for the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesMySqlTaskInputInternal + + { + /// Connection information for SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo ConnectionInfo { get; set; } + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Port for Server + int ConnectionInfoPort { get; set; } + /// Name of the server + string ConnectionInfoServerName { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// List of database names to collect tables for + string[] SelectedDatabase { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.json.cs new file mode 100644 index 000000000000..1e587eea481d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskInput.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that collects user tables for the given list of databases + public partial class GetUserTablesMySqlTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesMySqlTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesMySqlTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_connectionInfo = If( json?.PropertyT("connectionInfo"), out var __jsonConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonConnectionInfo) : ConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SelectedDatabase;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._connectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._connectionInfo.ToJson(null,serializationMode) : null, "connectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..064e87d819a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output of the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesMySqlTaskOutputTypeConverter))] + public partial class GetUserTablesMySqlTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesMySqlTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesMySqlTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesMySqlTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("DatabasesToTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).DatabasesToTable = (string) content.GetValueForProperty("DatabasesToTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).DatabasesToTable, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesMySqlTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("DatabasesToTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).DatabasesToTable = (string) content.GetValueForProperty("DatabasesToTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).DatabasesToTable, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output of the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesMySqlTaskOutputTypeConverter))] + public partial interface IGetUserTablesMySqlTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..468ec66c0570 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesMySqlTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesMySqlTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesMySqlTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesMySqlTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.cs new file mode 100644 index 000000000000..3494c39b0c6f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that collects user tables for the given list of databases + public partial class GetUserTablesMySqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal + { + + /// Backing field for property. + private string _databasesToTable; + + /// Mapping from database name to list of tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabasesToTable { get => this._databasesToTable; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for DatabasesToTable + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal.DatabasesToTable { get => this._databasesToTable; set { {_databasesToTable = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public GetUserTablesMySqlTaskOutput() + { + + } + } + /// Output of the task that collects user tables for the given list of databases + public partial interface IGetUserTablesMySqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Mapping from database name to list of tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mapping from database name to list of tables", + SerializedName = @"databasesToTables", + PossibleTypes = new [] { typeof(string) })] + string DatabasesToTable { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output of the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesMySqlTaskOutputInternal + + { + /// Mapping from database name to list of tables + string DatabasesToTable { get; set; } + /// Result identifier + string Id { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.json.cs new file mode 100644 index 000000000000..eb80e707c74c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskOutput.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that collects user tables for the given list of databases + public partial class GetUserTablesMySqlTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesMySqlTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesMySqlTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_databasesToTable = If( json?.PropertyT("databasesToTables"), out var __jsonDatabasesToTables) ? (string)__jsonDatabasesToTables : (string)DatabasesToTable;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databasesToTable)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databasesToTable.ToString()) : null, "databasesToTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..75afd182d32a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.PowerShell.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesMySqlTaskPropertiesTypeConverter))] + public partial class GetUserTablesMySqlTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesMySqlTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesMySqlTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesMySqlTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputSelectedDatabase = (string[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesMySqlTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputSelectedDatabase = (string[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesMySqlTaskPropertiesTypeConverter))] + public partial interface IGetUserTablesMySqlTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..a1a9953896f4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesMySqlTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesMySqlTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesMySqlTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesMySqlTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.cs new file mode 100644 index 000000000000..e61a86e6fd78 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesMySqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoPort = value ?? default(int); } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoServerName = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfoUserName = value ?? null; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskInput()); set => this._input = value; } + + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] InputSelectedDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).SelectedDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).SelectedDatabase = value ?? null /* arrayOf */; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal.InputConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInputInternal)Input).ConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public GetUserTablesMySqlTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that collects user tables for the given list of databases + public partial interface IGetUserTablesMySqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of database names to collect tables for", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] InputSelectedDatabase { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput[] Output { get; } + + } + /// Properties for the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesMySqlTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Port for Server + int? ConnectionInfoPort { get; set; } + /// Name of the server + string ConnectionInfoServerName { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskInput Input { get; set; } + /// Connection information for SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo InputConnectionInfo { get; set; } + /// List of database names to collect tables for + string[] InputSelectedDatabase { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.json.cs new file mode 100644 index 000000000000..fe1aa652ddfd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesMySqlTaskProperties.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesMySqlTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesMySqlTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesMySqlTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesMySqlTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesMySqlTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.PowerShell.cs new file mode 100644 index 000000000000..ce7bde3e9307 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.PowerShell.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that gets the list of tables contained within a provided list of Oracle schemas. + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesOracleTaskInputTypeConverter))] + public partial class GetUserTablesOracleTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesOracleTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesOracleTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesOracleTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).SelectedSchema = (string[]) content.GetValueForProperty("SelectedSchema",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).SelectedSchema, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesOracleTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).SelectedSchema = (string[]) content.GetValueForProperty("SelectedSchema",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).SelectedSchema, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that gets the list of tables contained within a provided list of Oracle schemas. + [System.ComponentModel.TypeConverter(typeof(GetUserTablesOracleTaskInputTypeConverter))] + public partial interface IGetUserTablesOracleTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..5c280c57832d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesOracleTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesOracleTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesOracleTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesOracleTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.cs new file mode 100644 index 000000000000..eca717988b3b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that gets the list of tables contained within a provided list of Oracle schemas. + /// + public partial class GetUserTablesOracleTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo _connectionInfo; + + /// Information for connecting to Oracle source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo()); set => this._connectionInfo = value; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).DataSource = value ; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).Port = value ?? default(int); } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)ConnectionInfo).ServerVersion = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName = value ?? null; } + + /// Internal Acessors for ConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal.ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo()); set { {_connectionInfo = value;} } } + + /// Backing field for property. + private string[] _selectedSchema; + + /// List of Oracle schemas for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedSchema { get => this._selectedSchema; set => this._selectedSchema = value; } + + /// Creates an new instance. + public GetUserTablesOracleTaskInput() + { + + } + } + /// Input for the task that gets the list of tables contained within a provided list of Oracle schemas. + public partial interface IGetUserTablesOracleTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"EZConnect or TNSName connection string.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// List of Oracle schemas for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of Oracle schemas for which to collect tables", + SerializedName = @"selectedSchemas", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedSchema { get; set; } + + } + /// Input for the task that gets the list of tables contained within a provided list of Oracle schemas. + internal partial interface IGetUserTablesOracleTaskInputInternal + + { + /// Information for connecting to Oracle source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo ConnectionInfo { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + string ConnectionInfoDataSource { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// port for server + int? ConnectionInfoPort { get; set; } + /// name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// List of Oracle schemas for which to collect tables + string[] SelectedSchema { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.json.cs new file mode 100644 index 000000000000..83ad18e42025 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskInput.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that gets the list of tables contained within a provided list of Oracle schemas. + /// + public partial class GetUserTablesOracleTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesOracleTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesOracleTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_connectionInfo = If( json?.PropertyT("connectionInfo"), out var __jsonConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo.FromJson(__jsonConnectionInfo) : ConnectionInfo;} + {_selectedSchema = If( json?.PropertyT("selectedSchemas"), out var __jsonSelectedSchemas) ? If( __jsonSelectedSchemas as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SelectedSchema;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._connectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._connectionInfo.ToJson(null,serializationMode) : null, "connectionInfo" ,container.Add ); + if (null != this._selectedSchema) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedSchema ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("selectedSchemas",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..bde7c0c082c4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that gets the list of tables contained within a provided list of Oracle schemas. + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesOracleTaskOutputTypeConverter))] + public partial class GetUserTablesOracleTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesOracleTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesOracleTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesOracleTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[]) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).Table, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTableTypeConverter.ConvertFrom)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesOracleTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[]) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).Table, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTableTypeConverter.ConvertFrom)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that gets the list of tables contained within a provided list of Oracle schemas. + [System.ComponentModel.TypeConverter(typeof(GetUserTablesOracleTaskOutputTypeConverter))] + public partial interface IGetUserTablesOracleTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..3a038eeb54f8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesOracleTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesOracleTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesOracleTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesOracleTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.cs new file mode 100644 index 000000000000..26493a8651cc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that gets the list of tables contained within a provided list of Oracle schemas. + /// + public partial class GetUserTablesOracleTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal + { + + /// Internal Acessors for SchemaName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal.SchemaName { get => this._schemaName; set { {_schemaName = value;} } } + + /// Internal Acessors for Table + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal.Table { get => this._table; set { {_table = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _schemaName; + + /// The schema this result is for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SchemaName { get => this._schemaName; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] _table; + + /// List of valid tables found for this schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Table { get => this._table; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public GetUserTablesOracleTaskOutput() + { + + } + } + /// Output for the task that gets the list of tables contained within a provided list of Oracle schemas. + public partial interface IGetUserTablesOracleTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The schema this result is for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The schema this result is for", + SerializedName = @"schemaName", + PossibleTypes = new [] { typeof(string) })] + string SchemaName { get; } + /// List of valid tables found for this schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of valid tables found for this schema", + SerializedName = @"tables", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Table { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that gets the list of tables contained within a provided list of Oracle schemas. + internal partial interface IGetUserTablesOracleTaskOutputInternal + + { + /// The schema this result is for + string SchemaName { get; set; } + /// List of valid tables found for this schema + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Table { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.json.cs new file mode 100644 index 000000000000..71e1aaccdf09 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskOutput.json.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that gets the list of tables contained within a provided list of Oracle schemas. + /// + public partial class GetUserTablesOracleTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesOracleTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesOracleTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_schemaName = If( json?.PropertyT("schemaName"), out var __jsonSchemaName) ? (string)__jsonSchemaName : (string)SchemaName;} + {_table = If( json?.PropertyT("tables"), out var __jsonTables) ? If( __jsonTables as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTable.FromJson(__u) )) ))() : null : Table;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._schemaName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._schemaName.ToString()) : null, "schemaName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._table) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._table ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tables",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..0bb9e005baec --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.PowerShell.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that collects user tables for the given list of Oracle schemas + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesOracleTaskPropertiesTypeConverter))] + public partial class GetUserTablesOracleTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesOracleTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesOracleTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesOracleTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputSelectedSchema = (string[]) content.GetValueForProperty("InputSelectedSchema",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputSelectedSchema, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesOracleTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputSelectedSchema = (string[]) content.GetValueForProperty("InputSelectedSchema",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).InputSelectedSchema, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that collects user tables for the given list of Oracle schemas + [System.ComponentModel.TypeConverter(typeof(GetUserTablesOracleTaskPropertiesTypeConverter))] + public partial interface IGetUserTablesOracleTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..af5ee83c0fdf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesOracleTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesOracleTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesOracleTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesOracleTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.cs new file mode 100644 index 000000000000..42ff72c5b2a2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of Oracle schemas + /// + public partial class GetUserTablesOracleTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoDataSource = value ?? null; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoPassword = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoPort = value ?? default(int); } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoServerVersion = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfoUserName = value ?? null; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskInput()); set => this._input = value; } + + /// List of Oracle schemas for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] InputSelectedSchema { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).SelectedSchema; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).SelectedSchema = value ?? null /* arrayOf */; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal.InputConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInputInternal)Input).ConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public GetUserTablesOracleTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that collects user tables for the given list of Oracle schemas + public partial interface IGetUserTablesOracleTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"EZConnect or TNSName connection string.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// List of Oracle schemas for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Oracle schemas for which to collect tables", + SerializedName = @"selectedSchemas", + PossibleTypes = new [] { typeof(string) })] + string[] InputSelectedSchema { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput[] Output { get; } + + } + /// Properties for the task that collects user tables for the given list of Oracle schemas + internal partial interface IGetUserTablesOracleTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + string ConnectionInfoDataSource { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// port for server + int? ConnectionInfoPort { get; set; } + /// name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskInput Input { get; set; } + /// Information for connecting to Oracle source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo InputConnectionInfo { get; set; } + /// List of Oracle schemas for which to collect tables + string[] InputSelectedSchema { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.json.cs new file mode 100644 index 000000000000..02664d154b54 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesOracleTaskProperties.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of Oracle schemas + /// + public partial class GetUserTablesOracleTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesOracleTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesOracleTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesOracleTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesOracleTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.PowerShell.cs new file mode 100644 index 000000000000..02f4ea0c893d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.PowerShell.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that gets the list of tables for a provided list of PostgreSQL databases. + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesPostgreSqlTaskInputTypeConverter))] + public partial class GetUserTablesPostgreSqlTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesPostgreSqlTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesPostgreSqlTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesPostgreSqlTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).SelectedDatabase = (string[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDatabaseName = (string) content.GetValueForProperty("ConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesPostgreSqlTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).SelectedDatabase = (string[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDatabaseName = (string) content.GetValueForProperty("ConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that gets the list of tables for a provided list of PostgreSQL databases. + [System.ComponentModel.TypeConverter(typeof(GetUserTablesPostgreSqlTaskInputTypeConverter))] + public partial interface IGetUserTablesPostgreSqlTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..bcb00d7ac038 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesPostgreSqlTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesPostgreSqlTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesPostgreSqlTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesPostgreSqlTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.cs new file mode 100644 index 000000000000..5bcb0e6432ba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that gets the list of tables for a provided list of PostgreSQL databases. + /// + public partial class GetUserTablesPostgreSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _connectionInfo; + + /// Information for connecting to PostgreSQL source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._connectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)ConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName = value ?? null; } + + /// Internal Acessors for ConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal.ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_connectionInfo = value;} } } + + /// Backing field for property. + private string[] _selectedDatabase; + + /// List of PostgreSQL databases for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Creates an new instance. + public GetUserTablesPostgreSqlTaskInput() + { + + } + } + /// Input for the task that gets the list of tables for a provided list of PostgreSQL databases. + public partial interface IGetUserTablesPostgreSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int ConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// List of PostgreSQL databases for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of PostgreSQL databases for which to collect tables", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedDatabase { get; set; } + + } + /// Input for the task that gets the list of tables for a provided list of PostgreSQL databases. + internal partial interface IGetUserTablesPostgreSqlTaskInputInternal + + { + /// Information for connecting to PostgreSQL source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo ConnectionInfo { get; set; } + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + string ConnectionInfoDataSource { get; set; } + /// Name of the database + string ConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Port for Server + int ConnectionInfoPort { get; set; } + /// server brand version + string ConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// List of PostgreSQL databases for which to collect tables + string[] SelectedDatabase { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.json.cs new file mode 100644 index 000000000000..d74521922101 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskInput.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that gets the list of tables for a provided list of PostgreSQL databases. + /// + public partial class GetUserTablesPostgreSqlTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesPostgreSqlTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesPostgreSqlTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_connectionInfo = If( json?.PropertyT("connectionInfo"), out var __jsonConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonConnectionInfo) : ConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SelectedDatabase;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._connectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._connectionInfo.ToJson(null,serializationMode) : null, "connectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..61a433a3bd14 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that gets the list of tables for a provided list of PostgreSQL databases. + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesPostgreSqlTaskOutputTypeConverter))] + public partial class GetUserTablesPostgreSqlTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesPostgreSqlTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesPostgreSqlTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesPostgreSqlTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[]) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).Table, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTableTypeConverter.ConvertFrom)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesPostgreSqlTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[]) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).Table, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTableTypeConverter.ConvertFrom)); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that gets the list of tables for a provided list of PostgreSQL databases. + [System.ComponentModel.TypeConverter(typeof(GetUserTablesPostgreSqlTaskOutputTypeConverter))] + public partial interface IGetUserTablesPostgreSqlTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..550cf42c7175 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesPostgreSqlTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesPostgreSqlTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesPostgreSqlTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesPostgreSqlTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.cs new file mode 100644 index 000000000000..6edfadaaa93b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that gets the list of tables for a provided list of PostgreSQL databases. + /// + public partial class GetUserTablesPostgreSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal + { + + /// Backing field for property. + private string _databaseName; + + /// The database this result is for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for Table + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal.Table { get => this._table; set { {_table = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] _table; + + /// List of valid tables found for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Table { get => this._table; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public GetUserTablesPostgreSqlTaskOutput() + { + + } + } + /// Output for the task that gets the list of tables for a provided list of PostgreSQL databases. + public partial interface IGetUserTablesPostgreSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The database this result is for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The database this result is for", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// List of valid tables found for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of valid tables found for this database", + SerializedName = @"tables", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Table { get; } + /// Validation errors associated with the task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors associated with the task", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the task that gets the list of tables for a provided list of PostgreSQL databases. + internal partial interface IGetUserTablesPostgreSqlTaskOutputInternal + + { + /// The database this result is for + string DatabaseName { get; set; } + /// List of valid tables found for this database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable[] Table { get; set; } + /// Validation errors associated with the task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.json.cs new file mode 100644 index 000000000000..f539de253d81 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskOutput.json.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that gets the list of tables for a provided list of PostgreSQL databases. + /// + public partial class GetUserTablesPostgreSqlTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesPostgreSqlTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesPostgreSqlTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_table = If( json?.PropertyT("tables"), out var __jsonTables) ? If( __jsonTables as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseTable) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseTable.FromJson(__u) )) ))() : null : Table;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._table) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._table ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tables",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._validationError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("validationErrors",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..671466fd0b88 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.PowerShell.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesPostgreSqlTaskPropertiesTypeConverter))] + public partial class GetUserTablesPostgreSqlTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesPostgreSqlTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesPostgreSqlTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesPostgreSqlTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputSelectedDatabase = (string[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDatabaseName = (string) content.GetValueForProperty("ConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesPostgreSqlTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputSelectedDatabase = (string[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDatabaseName = (string) content.GetValueForProperty("ConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPort = (int) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesPostgreSqlTaskPropertiesTypeConverter))] + public partial interface IGetUserTablesPostgreSqlTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..a4070f304b59 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesPostgreSqlTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesPostgreSqlTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesPostgreSqlTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesPostgreSqlTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.cs new file mode 100644 index 000000000000..11425aed13d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.cs @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesPostgreSqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoDataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoDatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoPort = value ?? default(int); } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfoUserName = value ?? null; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskInput()); set => this._input = value; } + + /// List of PostgreSQL databases for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] InputSelectedDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).SelectedDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).SelectedDatabase = value ?? null /* arrayOf */; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal.InputConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInputInternal)Input).ConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public GetUserTablesPostgreSqlTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that collects user tables for the given list of databases + public partial interface IGetUserTablesPostgreSqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// List of PostgreSQL databases for which to collect tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of PostgreSQL databases for which to collect tables", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] InputSelectedDatabase { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput[] Output { get; } + + } + /// Properties for the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesPostgreSqlTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source + string ConnectionInfoDataSource { get; set; } + /// Name of the database + string ConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Port for Server + int? ConnectionInfoPort { get; set; } + /// server brand version + string ConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskInput Input { get; set; } + /// Information for connecting to PostgreSQL source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo InputConnectionInfo { get; set; } + /// List of PostgreSQL databases for which to collect tables + string[] InputSelectedDatabase { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.json.cs new file mode 100644 index 000000000000..620a7e552271 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesPostgreSqlTaskProperties.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesPostgreSqlTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesPostgreSqlTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesPostgreSqlTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesPostgreSqlTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesPostgreSqlTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..14757ee7a8cc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.PowerShell.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlSyncTaskInputTypeConverter))] + public partial class GetUserTablesSqlSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesSqlSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesSqlSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesSqlSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedSourceDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedSourceDatabase = (string[]) content.GetValueForProperty("SelectedSourceDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedSourceDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SelectedTargetDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedTargetDatabase = (string[]) content.GetValueForProperty("SelectedTargetDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedTargetDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesSqlSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedSourceDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedSourceDatabase = (string[]) content.GetValueForProperty("SelectedSourceDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedSourceDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SelectedTargetDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedTargetDatabase = (string[]) content.GetValueForProperty("SelectedTargetDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SelectedTargetDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlSyncTaskInputTypeConverter))] + public partial interface IGetUserTablesSqlSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..f464584d9488 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesSqlSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesSqlSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesSqlSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesSqlSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.cs new file mode 100644 index 000000000000..85aa936e566c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private string[] _selectedSourceDatabase; + + /// List of source database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedSourceDatabase { get => this._selectedSourceDatabase; set => this._selectedSourceDatabase = value; } + + /// Backing field for property. + private string[] _selectedTargetDatabase; + + /// List of target database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedTargetDatabase { get => this._selectedTargetDatabase; set => this._selectedTargetDatabase = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Connection information for SQL DB + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public GetUserTablesSqlSyncTaskInput() + { + + } + } + /// Input for the task that collects user tables for the given list of databases + public partial interface IGetUserTablesSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of source database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of source database names to collect tables for", + SerializedName = @"selectedSourceDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedSourceDatabase { get; set; } + /// List of target database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of target database names to collect tables for", + SerializedName = @"selectedTargetDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedTargetDatabase { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesSqlSyncTaskInputInternal + + { + /// List of source database names to collect tables for + string[] SelectedSourceDatabase { get; set; } + /// List of target database names to collect tables for + string[] SelectedTargetDatabase { get; set; } + /// Connection information for SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Connection information for SQL DB + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.json.cs new file mode 100644 index 000000000000..b23e4eccddc4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskInput.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesSqlSyncTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesSqlSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_selectedSourceDatabase = If( json?.PropertyT("selectedSourceDatabases"), out var __jsonSelectedSourceDatabases) ? If( __jsonSelectedSourceDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SelectedSourceDatabase;} + {_selectedTargetDatabase = If( json?.PropertyT("selectedTargetDatabases"), out var __jsonSelectedTargetDatabases) ? If( __jsonSelectedTargetDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : SelectedTargetDatabase;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + if (null != this._selectedSourceDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedSourceDatabase ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("selectedSourceDatabases",__w); + } + if (null != this._selectedTargetDatabase) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._selectedTargetDatabase ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("selectedTargetDatabases",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..48316ee7fb00 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output of the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlSyncTaskOutputTypeConverter))] + public partial class GetUserTablesSqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesSqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesSqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesSqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabasesToSourceTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToSourceTable = (string) content.GetValueForProperty("DatabasesToSourceTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToSourceTable, global::System.Convert.ToString); + } + if (content.Contains("DatabasesToTargetTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToTargetTable = (string) content.GetValueForProperty("DatabasesToTargetTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToTargetTable, global::System.Convert.ToString); + } + if (content.Contains("TableValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).TableValidationError = (string) content.GetValueForProperty("TableValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).TableValidationError, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesSqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabasesToSourceTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToSourceTable = (string) content.GetValueForProperty("DatabasesToSourceTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToSourceTable, global::System.Convert.ToString); + } + if (content.Contains("DatabasesToTargetTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToTargetTable = (string) content.GetValueForProperty("DatabasesToTargetTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).DatabasesToTargetTable, global::System.Convert.ToString); + } + if (content.Contains("TableValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).TableValidationError = (string) content.GetValueForProperty("TableValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).TableValidationError, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output of the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlSyncTaskOutputTypeConverter))] + public partial interface IGetUserTablesSqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..f389ce8672b2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesSqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesSqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesSqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesSqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.cs new file mode 100644 index 000000000000..9c8de31359ce --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal + { + + /// Backing field for property. + private string _databasesToSourceTable; + + /// Mapping from database name to list of source tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabasesToSourceTable { get => this._databasesToSourceTable; } + + /// Backing field for property. + private string _databasesToTargetTable; + + /// Mapping from database name to list of target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabasesToTargetTable { get => this._databasesToTargetTable; } + + /// Internal Acessors for DatabasesToSourceTable + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal.DatabasesToSourceTable { get => this._databasesToSourceTable; set { {_databasesToSourceTable = value;} } } + + /// Internal Acessors for DatabasesToTargetTable + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal.DatabasesToTargetTable { get => this._databasesToTargetTable; set { {_databasesToTargetTable = value;} } } + + /// Internal Acessors for TableValidationError + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal.TableValidationError { get => this._tableValidationError; set { {_tableValidationError = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _tableValidationError; + + /// Mapping from database name to list of validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TableValidationError { get => this._tableValidationError; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public GetUserTablesSqlSyncTaskOutput() + { + + } + } + /// Output of the task that collects user tables for the given list of databases + public partial interface IGetUserTablesSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Mapping from database name to list of source tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mapping from database name to list of source tables", + SerializedName = @"databasesToSourceTables", + PossibleTypes = new [] { typeof(string) })] + string DatabasesToSourceTable { get; } + /// Mapping from database name to list of target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mapping from database name to list of target tables", + SerializedName = @"databasesToTargetTables", + PossibleTypes = new [] { typeof(string) })] + string DatabasesToTargetTable { get; } + /// Mapping from database name to list of validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mapping from database name to list of validation errors", + SerializedName = @"tableValidationErrors", + PossibleTypes = new [] { typeof(string) })] + string TableValidationError { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output of the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesSqlSyncTaskOutputInternal + + { + /// Mapping from database name to list of source tables + string DatabasesToSourceTable { get; set; } + /// Mapping from database name to list of target tables + string DatabasesToTargetTable { get; set; } + /// Mapping from database name to list of validation errors + string TableValidationError { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..e0068e2615a8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskOutput.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesSqlSyncTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesSqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databasesToSourceTable = If( json?.PropertyT("databasesToSourceTables"), out var __jsonDatabasesToSourceTables) ? (string)__jsonDatabasesToSourceTables : (string)DatabasesToSourceTable;} + {_databasesToTargetTable = If( json?.PropertyT("databasesToTargetTables"), out var __jsonDatabasesToTargetTables) ? (string)__jsonDatabasesToTargetTables : (string)DatabasesToTargetTable;} + {_tableValidationError = If( json?.PropertyT("tableValidationErrors"), out var __jsonTableValidationErrors) ? (string)__jsonTableValidationErrors : (string)TableValidationError;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databasesToSourceTable)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databasesToSourceTable.ToString()) : null, "databasesToSourceTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databasesToTargetTable)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databasesToTargetTable.ToString()) : null, "databasesToTargetTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tableValidationError)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tableValidationError.ToString()) : null, "tableValidationErrors" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..74b868e91018 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlSyncTaskPropertiesTypeConverter))] + public partial class GetUserTablesSqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesSqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesSqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesSqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesSqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlSyncTaskPropertiesTypeConverter))] + public partial interface IGetUserTablesSqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..582b5e379a2a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesSqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesSqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesSqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesSqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.cs new file mode 100644 index 000000000000..02320250ab2e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public GetUserTablesSqlSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that collects user tables for the given list of databases + public partial interface IGetUserTablesSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput[] Output { get; } + + } + /// Properties for the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesSqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..f54bb9392171 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlSyncTaskProperties.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesSqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesSqlSyncTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesSqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.PowerShell.cs new file mode 100644 index 000000000000..19a519ea7ac9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.PowerShell.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlTaskInputTypeConverter))] + public partial class GetUserTablesSqlTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesSqlTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesSqlTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesSqlTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).SelectedDatabase = (string[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesSqlTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("ConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).SelectedDatabase = (string[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlTaskInputTypeConverter))] + public partial interface IGetUserTablesSqlTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..ce3436e7c434 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesSqlTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesSqlTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesSqlTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesSqlTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.cs new file mode 100644 index 000000000000..18115fbde9f3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _connectionInfo; + + /// Connection information for SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._connectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)ConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)ConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private string _encryptedKeyForSecureField; + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EncryptedKeyForSecureField { get => this._encryptedKeyForSecureField; set => this._encryptedKeyForSecureField = value; } + + /// Internal Acessors for ConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal.ConnectionInfo { get => (this._connectionInfo = this._connectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_connectionInfo = value;} } } + + /// Backing field for property. + private string[] _selectedDatabase; + + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Creates an new instance. + public GetUserTablesSqlTaskInput() + { + + } + } + /// Input for the task that collects user tables for the given list of databases + public partial interface IGetUserTablesSqlTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string EncryptedKeyForSecureField { get; set; } + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of database names to collect tables for", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedDatabase { get; set; } + + } + /// Input for the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesSqlTaskInputInternal + + { + /// Connection information for SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo ConnectionInfo { get; set; } + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string ConnectionInfoResourceId { get; set; } + /// server brand version + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// encrypted key for secure fields + string EncryptedKeyForSecureField { get; set; } + /// List of database names to collect tables for + string[] SelectedDatabase { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.json.cs new file mode 100644 index 000000000000..ec8df2929e94 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskInput.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesSqlTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesSqlTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_connectionInfo = If( json?.PropertyT("connectionInfo"), out var __jsonConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonConnectionInfo) : ConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SelectedDatabase;} + {_encryptedKeyForSecureField = If( json?.PropertyT("encryptedKeyForSecureFields"), out var __jsonEncryptedKeyForSecureFields) ? (string)__jsonEncryptedKeyForSecureFields : (string)EncryptedKeyForSecureField;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._connectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._connectionInfo.ToJson(null,serializationMode) : null, "connectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AddIf( null != (((object)this._encryptedKeyForSecureField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._encryptedKeyForSecureField.ToString()) : null, "encryptedKeyForSecureFields" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..db69b0b9a058 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output of the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlTaskOutputTypeConverter))] + public partial class GetUserTablesSqlTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesSqlTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesSqlTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesSqlTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("DatabasesToTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).DatabasesToTable = (string) content.GetValueForProperty("DatabasesToTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).DatabasesToTable, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesSqlTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("DatabasesToTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).DatabasesToTable = (string) content.GetValueForProperty("DatabasesToTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).DatabasesToTable, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output of the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlTaskOutputTypeConverter))] + public partial interface IGetUserTablesSqlTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..ecdadab71fa3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesSqlTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesSqlTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesSqlTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesSqlTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.cs new file mode 100644 index 000000000000..22d7d5aeddee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal + { + + /// Backing field for property. + private string _databasesToTable; + + /// Mapping from database name to list of tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabasesToTable { get => this._databasesToTable; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for DatabasesToTable + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal.DatabasesToTable { get => this._databasesToTable; set { {_databasesToTable = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public GetUserTablesSqlTaskOutput() + { + + } + } + /// Output of the task that collects user tables for the given list of databases + public partial interface IGetUserTablesSqlTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Mapping from database name to list of tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mapping from database name to list of tables", + SerializedName = @"databasesToTables", + PossibleTypes = new [] { typeof(string) })] + string DatabasesToTable { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output of the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesSqlTaskOutputInternal + + { + /// Mapping from database name to list of tables + string DatabasesToTable { get; set; } + /// Result identifier + string Id { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.json.cs new file mode 100644 index 000000000000..5f358a848784 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskOutput.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output of the task that collects user tables for the given list of databases + public partial class GetUserTablesSqlTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesSqlTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesSqlTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_databasesToTable = If( json?.PropertyT("databasesToTables"), out var __jsonDatabasesToTables) ? (string)__jsonDatabasesToTables : (string)DatabasesToTable;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databasesToTable)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databasesToTable.ToString()) : null, "databasesToTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..edfc34c47d9a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.PowerShell.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlTaskPropertiesTypeConverter))] + public partial class GetUserTablesSqlTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GetUserTablesSqlTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GetUserTablesSqlTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GetUserTablesSqlTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputSelectedDatabase = (string[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("InputEncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputEncryptedKeyForSecureField = (string) content.GetValueForProperty("InputEncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputEncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GetUserTablesSqlTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("InputConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputSelectedDatabase = (string[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("InputEncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputEncryptedKeyForSecureField = (string) content.GetValueForProperty("InputEncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).InputEncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoType = (string) content.GetValueForProperty("ConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoUserName = (string) content.GetValueForProperty("ConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPassword = (string) content.GetValueForProperty("ConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource = (string) content.GetValueForProperty("ConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerName = (string) content.GetValueForProperty("ConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPort = (int?) content.GetValueForProperty("ConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion = (string) content.GetValueForProperty("ConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("ConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId = (string) content.GetValueForProperty("ConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("ConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("ConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("ConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("ConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("ConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal)this).ConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that collects user tables for the given list of databases + [System.ComponentModel.TypeConverter(typeof(GetUserTablesSqlTaskPropertiesTypeConverter))] + public partial interface IGetUserTablesSqlTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..fd12cbb50534 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GetUserTablesSqlTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GetUserTablesSqlTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GetUserTablesSqlTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GetUserTablesSqlTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.cs new file mode 100644 index 000000000000..08f0ba97a9f5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.cs @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesSqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfoUserName = value ?? null; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskInput()); set => this._input = value; } + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputEncryptedKeyForSecureField { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).EncryptedKeyForSecureField; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).EncryptedKeyForSecureField = value ?? null; } + + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] InputSelectedDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).SelectedDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).SelectedDatabase = value ?? null /* arrayOf */; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal.InputConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInputInternal)Input).ConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Backing field for property. + private string _taskId; + + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public GetUserTablesSqlTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that collects user tables for the given list of databases + public partial interface IGetUserTablesSqlTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ConnectionInfoUserName { get; set; } + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string InputEncryptedKeyForSecureField { get; set; } + /// List of database names to collect tables for + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of database names to collect tables for", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(string) })] + string[] InputSelectedDatabase { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput[] Output { get; } + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task id ", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Properties for the task that collects user tables for the given list of databases + internal partial interface IGetUserTablesSqlTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Additional connection settings + string ConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? ConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string ConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? ConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string ConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? ConnectionInfoPlatform { get; set; } + /// Port for Server + int? ConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string ConnectionInfoResourceId { get; set; } + /// server brand version + string ConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string ConnectionInfoServerName { get; set; } + /// server version + string ConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? ConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string ConnectionInfoType { get; set; } + /// User name + string ConnectionInfoUserName { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskInput Input { get; set; } + /// Connection information for SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo InputConnectionInfo { get; set; } + /// encrypted key for secure fields + string InputEncryptedKeyForSecureField { get; set; } + /// List of database names to collect tables for + string[] InputSelectedDatabase { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput[] Output { get; set; } + /// Task id + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.json.cs new file mode 100644 index 000000000000..4c71637e5889 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/GetUserTablesSqlTaskProperties.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that collects user tables for the given list of databases + /// + public partial class GetUserTablesSqlTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new GetUserTablesSqlTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal GetUserTablesSqlTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IGetUserTablesSqlTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.GetUserTablesSqlTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.PowerShell.cs new file mode 100644 index 000000000000..8478bd7402e9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the service task to install an OCI driver. + [System.ComponentModel.TypeConverter(typeof(InstallOciDriverTaskInputTypeConverter))] + public partial class InstallOciDriverTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InstallOciDriverTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InstallOciDriverTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InstallOciDriverTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverPackageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInputInternal)this).DriverPackageName = (string) content.GetValueForProperty("DriverPackageName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInputInternal)this).DriverPackageName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InstallOciDriverTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverPackageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInputInternal)this).DriverPackageName = (string) content.GetValueForProperty("DriverPackageName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInputInternal)this).DriverPackageName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the service task to install an OCI driver. + [System.ComponentModel.TypeConverter(typeof(InstallOciDriverTaskInputTypeConverter))] + public partial interface IInstallOciDriverTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..40f27695e76d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InstallOciDriverTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InstallOciDriverTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InstallOciDriverTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InstallOciDriverTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.cs new file mode 100644 index 000000000000..8266c5da7a32 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the service task to install an OCI driver. + public partial class InstallOciDriverTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInputInternal + { + + /// Backing field for property. + private string _driverPackageName; + + /// Name of the uploaded driver package to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DriverPackageName { get => this._driverPackageName; set => this._driverPackageName = value; } + + /// Creates an new instance. + public InstallOciDriverTaskInput() + { + + } + } + /// Input for the service task to install an OCI driver. + public partial interface IInstallOciDriverTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the uploaded driver package to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the uploaded driver package to install.", + SerializedName = @"driverPackageName", + PossibleTypes = new [] { typeof(string) })] + string DriverPackageName { get; set; } + + } + /// Input for the service task to install an OCI driver. + internal partial interface IInstallOciDriverTaskInputInternal + + { + /// Name of the uploaded driver package to install. + string DriverPackageName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.json.cs new file mode 100644 index 000000000000..025ae4f4029f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskInput.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the service task to install an OCI driver. + public partial class InstallOciDriverTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new InstallOciDriverTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal InstallOciDriverTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_driverPackageName = If( json?.PropertyT("driverPackageName"), out var __jsonDriverPackageName) ? (string)__jsonDriverPackageName : (string)DriverPackageName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._driverPackageName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._driverPackageName.ToString()) : null, "driverPackageName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..5cb8f6f11706 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output for the service task to install an OCI driver. + [System.ComponentModel.TypeConverter(typeof(InstallOciDriverTaskOutputTypeConverter))] + public partial class InstallOciDriverTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InstallOciDriverTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InstallOciDriverTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InstallOciDriverTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InstallOciDriverTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the service task to install an OCI driver. + [System.ComponentModel.TypeConverter(typeof(InstallOciDriverTaskOutputTypeConverter))] + public partial interface IInstallOciDriverTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..72133b52d0d9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InstallOciDriverTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InstallOciDriverTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InstallOciDriverTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InstallOciDriverTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.cs new file mode 100644 index 000000000000..d131a65590aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the service task to install an OCI driver. + public partial class InstallOciDriverTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutputInternal + { + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public InstallOciDriverTaskOutput() + { + + } + } + /// Output for the service task to install an OCI driver. + public partial interface IInstallOciDriverTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the service task to install an OCI driver. + internal partial interface IInstallOciDriverTaskOutputInternal + + { + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.json.cs new file mode 100644 index 000000000000..021094279d79 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskOutput.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the service task to install an OCI driver. + public partial class InstallOciDriverTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new InstallOciDriverTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal InstallOciDriverTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..cd2ccdeb26de --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that installs an OCI driver. + [System.ComponentModel.TypeConverter(typeof(InstallOciDriverTaskPropertiesTypeConverter))] + public partial class InstallOciDriverTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InstallOciDriverTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InstallOciDriverTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InstallOciDriverTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputDriverPackageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).InputDriverPackageName = (string) content.GetValueForProperty("InputDriverPackageName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).InputDriverPackageName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InstallOciDriverTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputDriverPackageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).InputDriverPackageName = (string) content.GetValueForProperty("InputDriverPackageName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal)this).InputDriverPackageName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that installs an OCI driver. + [System.ComponentModel.TypeConverter(typeof(InstallOciDriverTaskPropertiesTypeConverter))] + public partial interface IInstallOciDriverTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..774d193b9fc9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InstallOciDriverTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InstallOciDriverTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InstallOciDriverTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InstallOciDriverTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.cs new file mode 100644 index 000000000000..a592f54984c0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that installs an OCI driver. + public partial class InstallOciDriverTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput _input; + + /// Input for the service task to install an OCI driver. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskInput()); set => this._input = value; } + + /// Name of the uploaded driver package to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputDriverPackageName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInputInternal)Input).DriverPackageName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInputInternal)Input).DriverPackageName = value ?? null; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public InstallOciDriverTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that installs an OCI driver. + public partial interface IInstallOciDriverTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Name of the uploaded driver package to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the uploaded driver package to install.", + SerializedName = @"driverPackageName", + PossibleTypes = new [] { typeof(string) })] + string InputDriverPackageName { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput[] Output { get; } + + } + /// Properties for the task that installs an OCI driver. + internal partial interface IInstallOciDriverTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Input for the service task to install an OCI driver. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskInput Input { get; set; } + /// Name of the uploaded driver package to install. + string InputDriverPackageName { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.json.cs new file mode 100644 index 000000000000..08becea54cd9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/InstallOciDriverTaskProperties.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that installs an OCI driver. + public partial class InstallOciDriverTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new InstallOciDriverTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal InstallOciDriverTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IInstallOciDriverTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.InstallOciDriverTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.PowerShell.cs new file mode 100644 index 000000000000..c2e4e3f8f11d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Integration Runtime Monitoring Data. + [System.ComponentModel.TypeConverter(typeof(IntegrationRuntimeMonitoringDataTypeConverter))] + public partial class IntegrationRuntimeMonitoringData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IntegrationRuntimeMonitoringData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IntegrationRuntimeMonitoringData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IntegrationRuntimeMonitoringData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IntegrationRuntimeMonitoringData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Integration Runtime Monitoring Data. + [System.ComponentModel.TypeConverter(typeof(IntegrationRuntimeMonitoringDataTypeConverter))] + public partial interface IIntegrationRuntimeMonitoringData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.TypeConverter.cs new file mode 100644 index 000000000000..159b1c1c8e77 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IntegrationRuntimeMonitoringDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IntegrationRuntimeMonitoringData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IntegrationRuntimeMonitoringData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IntegrationRuntimeMonitoringData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.cs new file mode 100644 index 000000000000..aa5900774500 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Integration Runtime Monitoring Data. + public partial class IntegrationRuntimeMonitoringData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Node + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringDataInternal.Node { get => this._node; set { {_node = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of Integration Runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData[] _node; + + /// Integration Runtime node monitoring data. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData[] Node { get => this._node; } + + /// Creates an new instance. + public IntegrationRuntimeMonitoringData() + { + + } + } + /// Integration Runtime Monitoring Data. + public partial interface IIntegrationRuntimeMonitoringData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The name of Integration Runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of Integration Runtime.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Integration Runtime node monitoring data. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Integration Runtime node monitoring data.", + SerializedName = @"nodes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData[] Node { get; } + + } + /// Integration Runtime Monitoring Data. + internal partial interface IIntegrationRuntimeMonitoringDataInternal + + { + /// The name of Integration Runtime. + string Name { get; set; } + /// Integration Runtime node monitoring data. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData[] Node { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.json.cs new file mode 100644 index 000000000000..e23d55c9e2f9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/IntegrationRuntimeMonitoringData.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Integration Runtime Monitoring Data. + public partial class IntegrationRuntimeMonitoringData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new IntegrationRuntimeMonitoringData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal IntegrationRuntimeMonitoringData(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_node = If( json?.PropertyT("nodes"), out var __jsonNodes) ? If( __jsonNodes as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringData.FromJson(__u) )) ))() : null : Node;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._node) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._node ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("nodes",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.PowerShell.cs new file mode 100644 index 000000000000..3b97e751dca7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties required to create a connection to Azure SQL database Managed instance + /// + [System.ComponentModel.TypeConverter(typeof(MiSqlConnectionInfoTypeConverter))] + public partial class MiSqlConnectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MiSqlConnectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MiSqlConnectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MiSqlConnectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)this).ManagedInstanceResourceId = (string) content.GetValueForProperty("ManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)this).ManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MiSqlConnectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)this).ManagedInstanceResourceId = (string) content.GetValueForProperty("ManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)this).ManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties required to create a connection to Azure SQL database Managed instance + [System.ComponentModel.TypeConverter(typeof(MiSqlConnectionInfoTypeConverter))] + public partial interface IMiSqlConnectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..295585f7631e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MiSqlConnectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MiSqlConnectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MiSqlConnectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MiSqlConnectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.cs new file mode 100644 index 000000000000..d91f513c78a9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties required to create a connection to Azure SQL database Managed instance + /// + public partial class MiSqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(); + + /// Backing field for property. + private string _managedInstanceResourceId; + + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ManagedInstanceResourceId { get => this._managedInstanceResourceId; set => this._managedInstanceResourceId = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public MiSqlConnectionInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectionInfo), __connectionInfo); + await eventListener.AssertObjectIsValid(nameof(__connectionInfo), __connectionInfo); + } + } + /// Properties required to create a connection to Azure SQL database Managed instance + public partial interface IMiSqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo + { + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource id for Azure SQL database Managed instance", + SerializedName = @"managedInstanceResourceId", + PossibleTypes = new [] { typeof(string) })] + string ManagedInstanceResourceId { get; set; } + + } + /// Properties required to create a connection to Azure SQL database Managed instance + internal partial interface IMiSqlConnectionInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal + { + /// Resource id for Azure SQL database Managed instance + string ManagedInstanceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.json.cs new file mode 100644 index 000000000000..780cb389c342 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MiSqlConnectionInfo.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties required to create a connection to Azure SQL database Managed instance + /// + public partial class MiSqlConnectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MiSqlConnectionInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MiSqlConnectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(json); + {_managedInstanceResourceId = If( json?.PropertyT("managedInstanceResourceId"), out var __jsonManagedInstanceResourceId) ? (string)__jsonManagedInstanceResourceId : (string)ManagedInstanceResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectionInfo?.ToJson(container, serializationMode); + AddIf( null != (((object)this._managedInstanceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._managedInstanceResourceId.ToString()) : null, "managedInstanceResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.PowerShell.cs new file mode 100644 index 000000000000..b0380dc9997a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for command that completes online migration for an Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMiSyncCompleteCommandInputTypeConverter))] + public partial class MigrateMiSyncCompleteCommandInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMiSyncCompleteCommandInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMiSyncCompleteCommandInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMiSyncCompleteCommandInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInputInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInputInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMiSyncCompleteCommandInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInputInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInputInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for command that completes online migration for an Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateMiSyncCompleteCommandInputTypeConverter))] + public partial interface IMigrateMiSyncCompleteCommandInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.TypeConverter.cs new file mode 100644 index 000000000000..a2de9794efaf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMiSyncCompleteCommandInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMiSyncCompleteCommandInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMiSyncCompleteCommandInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMiSyncCompleteCommandInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.cs new file mode 100644 index 000000000000..c296ab10bf2d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for command that completes online migration for an Azure SQL Database Managed Instance. + /// + public partial class MigrateMiSyncCompleteCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInputInternal + { + + /// Backing field for property. + private string _sourceDatabaseName; + + /// Name of managed instance database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceDatabaseName { get => this._sourceDatabaseName; set => this._sourceDatabaseName = value; } + + /// Creates an new instance. + public MigrateMiSyncCompleteCommandInput() + { + + } + } + /// Input for command that completes online migration for an Azure SQL Database Managed Instance. + public partial interface IMigrateMiSyncCompleteCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of managed instance database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of managed instance database", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; set; } + + } + /// Input for command that completes online migration for an Azure SQL Database Managed Instance. + internal partial interface IMigrateMiSyncCompleteCommandInputInternal + + { + /// Name of managed instance database + string SourceDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.json.cs new file mode 100644 index 000000000000..88652e6b734d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandInput.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for command that completes online migration for an Azure SQL Database Managed Instance. + /// + public partial class MigrateMiSyncCompleteCommandInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMiSyncCompleteCommandInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMiSyncCompleteCommandInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceDatabaseName = If( json?.PropertyT("sourceDatabaseName"), out var __jsonSourceDatabaseName) ? (string)__jsonSourceDatabaseName : (string)SourceDatabaseName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceDatabaseName.ToString()) : null, "sourceDatabaseName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.PowerShell.cs new file mode 100644 index 000000000000..6b4c2097da87 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for command that completes online migration for an Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMiSyncCompleteCommandOutputTypeConverter))] + public partial class MigrateMiSyncCompleteCommandOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMiSyncCompleteCommandOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMiSyncCompleteCommandOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMiSyncCompleteCommandOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutputInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutputInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMiSyncCompleteCommandOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutputInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutputInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for command that completes online migration for an Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateMiSyncCompleteCommandOutputTypeConverter))] + public partial interface IMigrateMiSyncCompleteCommandOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.TypeConverter.cs new file mode 100644 index 000000000000..060f81c37fdb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMiSyncCompleteCommandOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMiSyncCompleteCommandOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMiSyncCompleteCommandOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMiSyncCompleteCommandOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.cs new file mode 100644 index 000000000000..0aa8d2d11494 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for command that completes online migration for an Azure SQL Database Managed Instance. + /// + public partial class MigrateMiSyncCompleteCommandOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _error; + + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Error { get => this._error; set => this._error = value; } + + /// Creates an new instance. + public MigrateMiSyncCompleteCommandOutput() + { + + } + } + /// Output for command that completes online migration for an Azure SQL Database Managed Instance. + public partial interface IMigrateMiSyncCompleteCommandOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of errors that happened during the command execution", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Error { get; set; } + + } + /// Output for command that completes online migration for an Azure SQL Database Managed Instance. + internal partial interface IMigrateMiSyncCompleteCommandOutputInternal + + { + /// List of errors that happened during the command execution + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Error { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.json.cs new file mode 100644 index 000000000000..2c6c13039515 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandOutput.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for command that completes online migration for an Azure SQL Database Managed Instance. + /// + public partial class MigrateMiSyncCompleteCommandOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMiSyncCompleteCommandOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMiSyncCompleteCommandOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? If( __jsonErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._error) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._error ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("errors",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.PowerShell.cs new file mode 100644 index 000000000000..cf3f68a3e609 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the command that completes online migration for an Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMiSyncCompleteCommandPropertiesTypeConverter))] + public partial class MigrateMiSyncCompleteCommandProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMiSyncCompleteCommandProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMiSyncCompleteCommandProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMiSyncCompleteCommandProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Output, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandOutputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputSourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).InputSourceDatabaseName = (string) content.GetValueForProperty("InputSourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).InputSourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("OutputError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).OutputError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("OutputError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).OutputError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMiSyncCompleteCommandProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).Output, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandOutputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputSourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).InputSourceDatabaseName = (string) content.GetValueForProperty("InputSourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).InputSourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("OutputError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).OutputError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("OutputError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal)this).OutputError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the command that completes online migration for an Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateMiSyncCompleteCommandPropertiesTypeConverter))] + public partial interface IMigrateMiSyncCompleteCommandProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.TypeConverter.cs new file mode 100644 index 000000000000..02efb1a87737 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMiSyncCompleteCommandPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMiSyncCompleteCommandProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMiSyncCompleteCommandProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMiSyncCompleteCommandProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.cs new file mode 100644 index 000000000000..3ba5fa9b0337 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the command that completes online migration for an Azure SQL Database Managed Instance. + /// + public partial class MigrateMiSyncCompleteCommandProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(); + + /// Command type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType = value ; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput _input; + + /// Command input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandInput()); set => this._input = value; } + + /// Name of managed instance database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputSourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInputInternal)Input).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInputInternal)Input).SourceDatabaseName = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandInput()); set { {_input = value;} } } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandPropertiesInternal.Output { get => (this._output = this._output ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandOutput()); set { {_output = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput _output; + + /// Command output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput Output { get => (this._output = this._output ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandOutput()); } + + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] OutputError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutputInternal)Output).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutputInternal)Output).Error = value ?? null /* arrayOf */; } + + /// The state of the command. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; } + + /// Creates an new instance. + public MigrateMiSyncCompleteCommandProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__commandProperties), __commandProperties); + await eventListener.AssertObjectIsValid(nameof(__commandProperties), __commandProperties); + } + } + /// Properties for the command that completes online migration for an Azure SQL Database Managed Instance. + public partial interface IMigrateMiSyncCompleteCommandProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + { + /// Name of managed instance database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of managed instance database", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string InputSourceDatabaseName { get; set; } + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of errors that happened during the command execution", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] OutputError { get; set; } + + } + /// Properties for the command that completes online migration for an Azure SQL Database Managed Instance. + internal partial interface IMigrateMiSyncCompleteCommandPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal + { + /// Command input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandInput Input { get; set; } + /// Name of managed instance database + string InputSourceDatabaseName { get; set; } + /// Command output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandOutput Output { get; set; } + /// List of errors that happened during the command execution + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] OutputError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.json.cs new file mode 100644 index 000000000000..97e01891366d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMiSyncCompleteCommandProperties.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the command that completes online migration for an Azure SQL Database Managed Instance. + /// + public partial class MigrateMiSyncCompleteCommandProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMiSyncCompleteCommandProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMiSyncCompleteCommandProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMiSyncCompleteCommandProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMiSyncCompleteCommandOutput.FromJson(__jsonOutput) : Output;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __commandProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._output ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._output.ToJson(null,serializationMode) : null, "output" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..830d463ea5a2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that migrates data between MongoDB data sources + [System.ComponentModel.TypeConverter(typeof(MigrateMongoDbTaskPropertiesTypeConverter))] + public partial class MigrateMongoDbTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMongoDbTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMongoDbTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMongoDbTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMongoDbTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that migrates data between MongoDB data sources + [System.ComponentModel.TypeConverter(typeof(MigrateMongoDbTaskPropertiesTypeConverter))] + public partial interface IMigrateMongoDbTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..6b45a2c44e6b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMongoDbTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMongoDbTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMongoDbTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMongoDbTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.cs new file mode 100644 index 000000000000..3559fe7958a7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that migrates data between MongoDB data sources + public partial class MigrateMongoDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings _input; + + /// Describes how a MongoDB data migration should be performed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettings()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress[] _output; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public MigrateMongoDbTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that migrates data between MongoDB data sources + public partial interface IMigrateMongoDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Describes how a MongoDB data migration should be performed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes how a MongoDB data migration should be performed", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings Input { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress[] Output { get; } + + } + /// Properties for the task that migrates data between MongoDB data sources + internal partial interface IMigrateMongoDbTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Describes how a MongoDB data migration should be performed + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings Input { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.json.cs new file mode 100644 index 000000000000..ff695b502b22 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMongoDbTaskProperties.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that migrates data between MongoDB data sources + public partial class MigrateMongoDbTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMongoDbTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMongoDbTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMongoDbTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettings.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..cdd83ea3f7a6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Database specific information for offline MySQL to Azure Database for MySQL migration task inputs + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMapTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMapTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for offline MySQL to Azure Database for MySQL migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..a04b9641860e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.cs new file mode 100644 index 000000000000..0b3e816f5fe8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for offline MySQL to Azure Database for MySQL migration task inputs + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal + { + + /// Backing field for property. + private string _name; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap _tableMap; + + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap TableMap { get => (this._tableMap = this._tableMap ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap()); set => this._tableMap = value; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput() + { + + } + } + /// Database specific information for offline MySQL to Azure Database for MySQL migration task inputs + public partial interface IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of source to target tables", + SerializedName = @"tableMap", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of target database. Note: Target database will be truncated before starting migration.", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + + } + /// Database specific information for offline MySQL to Azure Database for MySQL migration task inputs + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputInternal + + { + /// Name of the database + string Name { get; set; } + /// Mapping of source to target tables + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + string TargetDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.json.cs new file mode 100644 index 000000000000..7d428e62d599 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for offline MySQL to Azure Database for MySQL migration task inputs + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_tableMap = If( json?.PropertyT("tableMap"), out var __jsonTableMap) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.FromJson(__jsonTableMap) : TableMap;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AddIf( null != this._tableMap ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tableMap.ToJson(null,serializationMode) : null, "tableMap" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.PowerShell.cs new file mode 100644 index 000000000000..5a4f3f509284 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMapTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMapTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.TypeConverter.cs new file mode 100644 index 000000000000..2648fc55dda2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMapTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.cs new file mode 100644 index 000000000000..1ba661a4e42b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMapInternal + { + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap() + { + + } + } + /// Mapping of source to target tables + public partial interface IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Mapping of source to target tables + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMapInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.dictionary.cs new file mode 100644 index 000000000000..4d4dba57aeb5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.json.cs new file mode 100644 index 000000000000..ae8c0a2a30d7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTableMap(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.PowerShell.cs new file mode 100644 index 000000000000..9ee1e140568e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.PowerShell.cs @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskInputTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("MakeSourceServerReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).MakeSourceServerReadOnly = (bool?) content.GetValueForProperty("MakeSourceServerReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).MakeSourceServerReadOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OptionalAgentSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).OptionalAgentSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings) content.GetValueForProperty("OptionalAgentSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).OptionalAgentSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("MakeSourceServerReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).MakeSourceServerReadOnly = (bool?) content.GetValueForProperty("MakeSourceServerReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).MakeSourceServerReadOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OptionalAgentSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).OptionalAgentSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings) content.GetValueForProperty("OptionalAgentSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).OptionalAgentSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskInputTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..7698a34c6ca9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.cs new file mode 100644 index 000000000000..b2a7eccf949c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal + { + + /// Backing field for property. + private string _encryptedKeyForSecureField; + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EncryptedKeyForSecureField { get => this._encryptedKeyForSecureField; set => this._encryptedKeyForSecureField = value; } + + /// Backing field for property. + private bool? _makeSourceServerReadOnly; + + /// Setting to set the source server read only + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? MakeSourceServerReadOnly { get => this._makeSourceServerReadOnly; set => this._makeSourceServerReadOnly = value; } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings _optionalAgentSetting; + + /// Optional parameters for fine tuning the data transfer rate during migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings OptionalAgentSetting { get => (this._optionalAgentSetting = this._optionalAgentSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings()); set => this._optionalAgentSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source MySQL + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Parameter to specify when the migration started + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; set => this._startedOn = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target Azure Database for MySQL + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskInput() + { + + } + } + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string EncryptedKeyForSecureField { get; set; } + /// Setting to set the source server read only + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Setting to set the source server read only", + SerializedName = @"makeSourceServerReadOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? MakeSourceServerReadOnly { get; set; } + /// Optional parameters for fine tuning the data transfer rate during migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional parameters for fine tuning the data transfer rate during migration", + SerializedName = @"optionalAgentSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings OptionalAgentSetting { get; set; } + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput[] SelectedDatabase { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int SourceConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Parameter to specify when the migration started + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parameter to specify when the migration started", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int TargetConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskInputInternal + + { + /// encrypted key for secure fields + string EncryptedKeyForSecureField { get; set; } + /// Setting to set the source server read only + bool? MakeSourceServerReadOnly { get; set; } + /// Optional parameters for fine tuning the data transfer rate during migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings OptionalAgentSetting { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput[] SelectedDatabase { get; set; } + /// Connection information for source MySQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int SourceConnectionInfoPort { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Parameter to specify when the migration started + global::System.DateTime? StartedOn { get; set; } + /// Connection information for target Azure Database for MySQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int TargetConnectionInfoPort { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.json.cs new file mode 100644 index 000000000000..a09cae44aed9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInput.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + {_makeSourceServerReadOnly = If( json?.PropertyT("makeSourceServerReadOnly"), out var __jsonMakeSourceServerReadOnly) ? (bool?)__jsonMakeSourceServerReadOnly : MakeSourceServerReadOnly;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_optionalAgentSetting = If( json?.PropertyT("optionalAgentSettings"), out var __jsonOptionalAgentSettings) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.FromJson(__jsonOptionalAgentSettings) : OptionalAgentSetting;} + {_encryptedKeyForSecureField = If( json?.PropertyT("encryptedKeyForSecureFields"), out var __jsonEncryptedKeyForSecureFields) ? (string)__jsonEncryptedKeyForSecureFields : (string)EncryptedKeyForSecureField;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AddIf( null != this._makeSourceServerReadOnly ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._makeSourceServerReadOnly) : null, "makeSourceServerReadOnly" ,container.Add ); + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + AddIf( null != this._optionalAgentSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._optionalAgentSetting.ToJson(null,serializationMode) : null, "optionalAgentSettings" ,container.Add ); + AddIf( null != (((object)this._encryptedKeyForSecureField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._encryptedKeyForSecureField.ToString()) : null, "encryptedKeyForSecureFields" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.PowerShell.cs new file mode 100644 index 000000000000..2cae35bee033 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Optional parameters for fine tuning the data transfer rate during migration + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettingsTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Optional parameters for fine tuning the data transfer rate during migration + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettingsTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.TypeConverter.cs new file mode 100644 index 000000000000..3261190c3807 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.cs new file mode 100644 index 000000000000..a09f2b355967 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Optional parameters for fine tuning the data transfer rate during migration + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettingsInternal + { + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings() + { + + } + } + /// Optional parameters for fine tuning the data transfer rate during migration + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Optional parameters for fine tuning the data transfer rate during migration + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettingsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.dictionary.cs new file mode 100644 index 000000000000..8a08db528f22 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.json.cs new file mode 100644 index 000000000000..f9244e097ab3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Optional parameters for fine tuning the data transfer rate during migration + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateMySqlAzureDbForMySqlOfflineTaskInputOptionalAgentSettings(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..a6ec5e4bef4e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..3fdfa9aa521a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.cs new file mode 100644 index 000000000000..0c4a1aabc68f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskOutput() + { + + } + } + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.json.cs new file mode 100644 index 000000000000..1628c4b74f77 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.json.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(json); + } + case "TableLevelOutput": + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(json); + } + case "ErrorOutput": + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(json); + } + } + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..0257e608ad55 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("NumberOfObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObject = (long?) content.GetValueForProperty("NumberOfObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObject, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NumberOfObjectsCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted = (long?) content.GetValueForProperty("NumberOfObjectsCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorCount = (long?) content.GetValueForProperty("ErrorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("LastStorageUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).LastStorageUpdate = (global::System.DateTime?) content.GetValueForProperty("LastStorageUpdate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).LastStorageUpdate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ObjectSummary = (string) content.GetValueForProperty("ObjectSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ObjectSummary, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("NumberOfObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObject = (long?) content.GetValueForProperty("NumberOfObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObject, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NumberOfObjectsCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted = (long?) content.GetValueForProperty("NumberOfObjectsCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorCount = (long?) content.GetValueForProperty("ErrorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("LastStorageUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).LastStorageUpdate = (global::System.DateTime?) content.GetValueForProperty("LastStorageUpdate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).LastStorageUpdate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ObjectSummary = (string) content.GetValueForProperty("ObjectSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal)this).ObjectSummary, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..22fe0075daac --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..83e3fd1405e9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(); + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private long? _errorCount; + + /// Number of database/object errors. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ErrorCount { get => this._errorCount; } + + /// Backing field for property. + private string _errorPrefix; + + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorPrefix { get => this._errorPrefix; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; } + + /// Backing field for property. + private global::System.DateTime? _lastStorageUpdate; + + /// Last time the storage was updated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastStorageUpdate { get => this._lastStorageUpdate; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ErrorCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.ErrorCount { get => this._errorCount; set { {_errorCount = value;} } } + + /// Internal Acessors for ErrorPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.ErrorPrefix { get => this._errorPrefix; set { {_errorPrefix = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for LastStorageUpdate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.LastStorageUpdate { get => this._lastStorageUpdate; set { {_lastStorageUpdate = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for NumberOfObject + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.NumberOfObject { get => this._numberOfObject; set { {_numberOfObject = value;} } } + + /// Internal Acessors for NumberOfObjectsCompleted + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.NumberOfObjectsCompleted { get => this._numberOfObjectsCompleted; set { {_numberOfObjectsCompleted = value;} } } + + /// Internal Acessors for ObjectSummary + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.ObjectSummary { get => this._objectSummary; set { {_objectSummary = value;} } } + + /// Internal Acessors for ResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.ResultPrefix { get => this._resultPrefix; set { {_resultPrefix = value;} } } + + /// Internal Acessors for Stage + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.Stage { get => this._stage; set { {_stage = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id = value; } + + /// Backing field for property. + private long? _numberOfObject; + + /// Number of objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? NumberOfObject { get => this._numberOfObject; } + + /// Backing field for property. + private long? _numberOfObjectsCompleted; + + /// Number of successfully completed objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? NumberOfObjectsCompleted { get => this._numberOfObjectsCompleted; } + + /// Backing field for property. + private string _objectSummary; + + /// Summary of object results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ObjectSummary { get => this._objectSummary; } + + /// Backing field for property. + private string _resultPrefix; + + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultPrefix { get => this._resultPrefix; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? _stage; + + /// Migration stage that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get => this._stage; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private string _statusMessage; + + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StatusMessage { get => this._statusMessage; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput + { + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Number of database/object errors. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of database/object errors.", + SerializedName = @"errorCount", + PossibleTypes = new [] { typeof(long) })] + long? ErrorCount { get; } + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all errors of the item", + SerializedName = @"errorPrefix", + PossibleTypes = new [] { typeof(string) })] + string ErrorPrefix { get; } + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings.", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Last time the storage was updated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last time the storage was updated", + SerializedName = @"lastStorageUpdate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStorageUpdate { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Number of objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of objects", + SerializedName = @"numberOfObjects", + PossibleTypes = new [] { typeof(long) })] + long? NumberOfObject { get; } + /// Number of successfully completed objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of successfully completed objects", + SerializedName = @"numberOfObjectsCompleted", + PossibleTypes = new [] { typeof(long) })] + long? NumberOfObjectsCompleted { get; } + /// Summary of object results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Summary of object results in the migration", + SerializedName = @"objectSummary", + PossibleTypes = new [] { typeof(string) })] + string ObjectSummary { get; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all sub-tem results of the item", + SerializedName = @"resultPrefix", + PossibleTypes = new [] { typeof(string) })] + string ResultPrefix { get; } + /// Migration stage that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration stage that this database is in", + SerializedName = @"stage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status message", + SerializedName = @"statusMessage", + PossibleTypes = new [] { typeof(string) })] + string StatusMessage { get; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal + { + /// Name of the database + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Number of database/object errors. + long? ErrorCount { get; set; } + /// Wildcard string prefix to use for querying all errors of the item + string ErrorPrefix { get; set; } + /// Migration exceptions and warnings. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Last time the storage was updated + global::System.DateTime? LastStorageUpdate { get; set; } + /// Migration progress message + string Message { get; set; } + /// Number of objects + long? NumberOfObject { get; set; } + /// Number of successfully completed objects + long? NumberOfObjectsCompleted { get; set; } + /// Summary of object results in the migration + string ObjectSummary { get; set; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + string ResultPrefix { get; set; } + /// Migration stage that this database is in + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Status message + string StatusMessage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..6dbfabc50c91 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)Stage;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_numberOfObject = If( json?.PropertyT("numberOfObjects"), out var __jsonNumberOfObjects) ? (long?)__jsonNumberOfObjects : NumberOfObject;} + {_numberOfObjectsCompleted = If( json?.PropertyT("numberOfObjectsCompleted"), out var __jsonNumberOfObjectsCompleted) ? (long?)__jsonNumberOfObjectsCompleted : NumberOfObjectsCompleted;} + {_errorCount = If( json?.PropertyT("errorCount"), out var __jsonErrorCount) ? (long?)__jsonErrorCount : ErrorCount;} + {_errorPrefix = If( json?.PropertyT("errorPrefix"), out var __jsonErrorPrefix) ? (string)__jsonErrorPrefix : (string)ErrorPrefix;} + {_resultPrefix = If( json?.PropertyT("resultPrefix"), out var __jsonResultPrefix) ? (string)__jsonResultPrefix : (string)ResultPrefix;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + {_lastStorageUpdate = If( json?.PropertyT("lastStorageUpdate"), out var __jsonLastStorageUpdate) ? global::System.DateTime.TryParse((string)__jsonLastStorageUpdate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastStorageUpdateValue) ? __jsonLastStorageUpdateValue : LastStorageUpdate : LastStorageUpdate;} + {_objectSummary = If( json?.PropertyT("objectSummary"), out var __jsonObjectSummary) ? (string)__jsonObjectSummary : (string)ObjectSummary;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._stage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stage.ToString()) : null, "stage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfObject ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._numberOfObject) : null, "numberOfObjects" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfObjectsCompleted ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._numberOfObjectsCompleted) : null, "numberOfObjectsCompleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._errorCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._errorCount) : null, "errorCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorPrefix.ToString()) : null, "errorPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resultPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultPrefix.ToString()) : null, "resultPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastStorageUpdate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastStorageUpdate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastStorageUpdate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectSummary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectSummary.ToString()) : null, "objectSummary" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..ac3e0a1fb8d4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..2a23689d2aa0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.cs new file mode 100644 index 000000000000..08698ec47740 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.json.cs new file mode 100644 index 000000000000..c3cf2b8c9af5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..05b534fb8a0a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationReportResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult) content.GetValueForProperty("MigrationReportResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResultTypeConverter.ConvertFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DurationInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DurationInSecond = (long?) content.GetValueForProperty("DurationInSecond",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DurationInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("DatabaseSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DatabaseSummary = (string) content.GetValueForProperty("DatabaseSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DatabaseSummary, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("LastStorageUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).LastStorageUpdate = (global::System.DateTime?) content.GetValueForProperty("LastStorageUpdate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).LastStorageUpdate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationReportResultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultId = (string) content.GetValueForProperty("MigrationReportResultId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultId, global::System.Convert.ToString); + } + if (content.Contains("MigrationReportResultReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl = (string) content.GetValueForProperty("MigrationReportResultReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationReportResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult) content.GetValueForProperty("MigrationReportResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResultTypeConverter.ConvertFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DurationInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DurationInSecond = (long?) content.GetValueForProperty("DurationInSecond",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DurationInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("DatabaseSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DatabaseSummary = (string) content.GetValueForProperty("DatabaseSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).DatabaseSummary, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("LastStorageUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).LastStorageUpdate = (global::System.DateTime?) content.GetValueForProperty("LastStorageUpdate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).LastStorageUpdate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationReportResultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultId = (string) content.GetValueForProperty("MigrationReportResultId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultId, global::System.Convert.ToString); + } + if (content.Contains("MigrationReportResultReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl = (string) content.GetValueForProperty("MigrationReportResultReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..2ff00a897afa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..7ece9f9400c5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(); + + /// Backing field for property. + private string _database; + + /// Selected databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Database { get => this._database; set => this._database = value; } + + /// Backing field for property. + private string _databaseSummary; + + /// Summary of database results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseSummary { get => this._databaseSummary; } + + /// Backing field for property. + private long? _durationInSecond; + + /// Duration of task execution in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DurationInSecond { get => this._durationInSecond; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; } + + /// Backing field for property. + private global::System.DateTime? _lastStorageUpdate; + + /// Last time the storage was updated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastStorageUpdate { get => this._lastStorageUpdate; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id = value; } + + /// Internal Acessors for DatabaseSummary + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.DatabaseSummary { get => this._databaseSummary; set { {_databaseSummary = value;} } } + + /// Internal Acessors for DurationInSecond + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.DurationInSecond { get => this._durationInSecond; set { {_durationInSecond = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for LastStorageUpdate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.LastStorageUpdate { get => this._lastStorageUpdate; set { {_lastStorageUpdate = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for MigrationReportResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.MigrationReportResult { get => (this._migrationReportResult = this._migrationReportResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult()); set { {_migrationReportResult = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult _migrationReportResult; + + /// + /// Migration Report Result, provides unique url for downloading your migration report. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult MigrationReportResult { get => (this._migrationReportResult = this._migrationReportResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult()); set => this._migrationReportResult = value; } + + /// Migration validation result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationReportResultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).Id = value ?? null; } + + /// The url of the report. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationReportResultReportUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).ReportUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).ReportUrl = value ?? null; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? _status; + + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get => this._status; } + + /// Backing field for property. + private string _statusMessage; + + /// Migration status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StatusMessage { get => this._statusMessage; } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput + { + /// Selected databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Selected databases as a map from database name to database id", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string Database { get; set; } + /// Summary of database results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Summary of database results in the migration", + SerializedName = @"databaseSummary", + PossibleTypes = new [] { typeof(string) })] + string DatabaseSummary { get; } + /// Duration of task execution in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Duration of task execution in seconds.", + SerializedName = @"durationInSeconds", + PossibleTypes = new [] { typeof(long) })] + long? DurationInSecond { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings.", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Last time the storage was updated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last time the storage was updated", + SerializedName = @"lastStorageUpdate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStorageUpdate { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Migration validation result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration validation result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string MigrationReportResultId { get; set; } + /// The url of the report. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url of the report.", + SerializedName = @"reportUrl", + PossibleTypes = new [] { typeof(string) })] + string MigrationReportResultReportUrl { get; set; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of migration", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; } + /// Migration status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status message", + SerializedName = @"statusMessage", + PossibleTypes = new [] { typeof(string) })] + string StatusMessage { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal + { + /// Selected databases as a map from database name to database id + string Database { get; set; } + /// Summary of database results in the migration + string DatabaseSummary { get; set; } + /// Duration of task execution in seconds. + long? DurationInSecond { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Migration exceptions and warnings. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Last time the storage was updated + global::System.DateTime? LastStorageUpdate { get; set; } + /// Migration progress message + string Message { get; set; } + /// + /// Migration Report Result, provides unique url for downloading your migration report. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult MigrationReportResult { get; set; } + /// Migration validation result identifier + string MigrationReportResultId { get; set; } + /// The url of the report. + string MigrationReportResultReportUrl { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current status of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; set; } + /// Migration status message + string StatusMessage { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..622f0aab2a25 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.json.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(json); + {_migrationReportResult = If( json?.PropertyT("migrationReportResult"), out var __jsonMigrationReportResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult.FromJson(__jsonMigrationReportResult) : MigrationReportResult;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_durationInSecond = If( json?.PropertyT("durationInSeconds"), out var __jsonDurationInSeconds) ? (long?)__jsonDurationInSeconds : DurationInSecond;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? (string)__jsonDatabases : (string)Database;} + {_databaseSummary = If( json?.PropertyT("databaseSummary"), out var __jsonDatabaseSummary) ? (string)__jsonDatabaseSummary : (string)DatabaseSummary;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + {_lastStorageUpdate = If( json?.PropertyT("lastStorageUpdate"), out var __jsonLastStorageUpdate) ? global::System.DateTime.TryParse((string)__jsonLastStorageUpdate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastStorageUpdateValue) ? __jsonLastStorageUpdateValue : LastStorageUpdate : LastStorageUpdate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput?.ToJson(container, serializationMode); + AddIf( null != this._migrationReportResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationReportResult.ToJson(null,serializationMode) : null, "migrationReportResult" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._durationInSecond ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._durationInSecond) : null, "durationInSeconds" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AddIf( null != (((object)this._database)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._database.ToString()) : null, "databases" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseSummary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseSummary.ToString()) : null, "databaseSummary" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastStorageUpdate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastStorageUpdate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastStorageUpdate" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.PowerShell.cs new file mode 100644 index 000000000000..ec1b59a3b3c7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.PowerShell.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("LastStorageUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).LastStorageUpdate = (global::System.DateTime?) content.GetValueForProperty("LastStorageUpdate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).LastStorageUpdate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("LastStorageUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).LastStorageUpdate = (global::System.DateTime?) content.GetValueForProperty("LastStorageUpdate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal)this).LastStorageUpdate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.TypeConverter.cs new file mode 100644 index 000000000000..bdf422ace063 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.cs new file mode 100644 index 000000000000..ca2aa1ea2650 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private string _errorPrefix; + + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorPrefix { get => this._errorPrefix; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; } + + /// Backing field for property. + private long? _itemsCompletedCount; + + /// Number of successfully completed items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ItemsCompletedCount { get => this._itemsCompletedCount; } + + /// Backing field for property. + private long? _itemsCount; + + /// Number of items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ItemsCount { get => this._itemsCount; } + + /// Backing field for property. + private global::System.DateTime? _lastStorageUpdate; + + /// Last time the storage was updated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastStorageUpdate { get => this._lastStorageUpdate; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ErrorPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.ErrorPrefix { get => this._errorPrefix; set { {_errorPrefix = value;} } } + + /// Internal Acessors for ItemsCompletedCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.ItemsCompletedCount { get => this._itemsCompletedCount; set { {_itemsCompletedCount = value;} } } + + /// Internal Acessors for ItemsCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.ItemsCount { get => this._itemsCount; set { {_itemsCount = value;} } } + + /// Internal Acessors for LastStorageUpdate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.LastStorageUpdate { get => this._lastStorageUpdate; set { {_lastStorageUpdate = value;} } } + + /// Internal Acessors for ObjectName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.ObjectName { get => this._objectName; set { {_objectName = value;} } } + + /// Internal Acessors for ResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.ResultPrefix { get => this._resultPrefix; set { {_resultPrefix = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + + /// Backing field for property. + private string _objectName; + + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ObjectName { get => this._objectName; } + + /// Backing field for property. + private string _resultPrefix; + + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultPrefix { get => this._resultPrefix; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal)__migrateMySqlAzureDbForMySqlOfflineTaskOutput).ResultType = value ; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private string _statusMessage; + + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StatusMessage { get => this._statusMessage; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlOfflineTaskOutput), __migrateMySqlAzureDbForMySqlOfflineTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all errors of the item", + SerializedName = @"errorPrefix", + PossibleTypes = new [] { typeof(string) })] + string ErrorPrefix { get; } + /// Number of successfully completed items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of successfully completed items", + SerializedName = @"itemsCompletedCount", + PossibleTypes = new [] { typeof(long) })] + long? ItemsCompletedCount { get; } + /// Number of items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of items", + SerializedName = @"itemsCount", + PossibleTypes = new [] { typeof(long) })] + long? ItemsCount { get; } + /// Last time the storage was updated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last time the storage was updated", + SerializedName = @"lastStorageUpdate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStorageUpdate { get; } + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the item", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string ObjectName { get; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all sub-tem results of the item", + SerializedName = @"resultPrefix", + PossibleTypes = new [] { typeof(string) })] + string ResultPrefix { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status message", + SerializedName = @"statusMessage", + PossibleTypes = new [] { typeof(string) })] + string StatusMessage { get; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Wildcard string prefix to use for querying all errors of the item + string ErrorPrefix { get; set; } + /// Number of successfully completed items + long? ItemsCompletedCount { get; set; } + /// Number of items + long? ItemsCount { get; set; } + /// Last time the storage was updated + global::System.DateTime? LastStorageUpdate { get; set; } + /// Name of the item + string ObjectName { get; set; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + string ResultPrefix { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Status message + string StatusMessage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.json.cs new file mode 100644 index 000000000000..6d5d820f896b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.json.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput(json); + {_objectName = If( json?.PropertyT("objectName"), out var __jsonObjectName) ? (string)__jsonObjectName : (string)ObjectName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_itemsCount = If( json?.PropertyT("itemsCount"), out var __jsonItemsCount) ? (long?)__jsonItemsCount : ItemsCount;} + {_itemsCompletedCount = If( json?.PropertyT("itemsCompletedCount"), out var __jsonItemsCompletedCount) ? (long?)__jsonItemsCompletedCount : ItemsCompletedCount;} + {_errorPrefix = If( json?.PropertyT("errorPrefix"), out var __jsonErrorPrefix) ? (string)__jsonErrorPrefix : (string)ErrorPrefix;} + {_resultPrefix = If( json?.PropertyT("resultPrefix"), out var __jsonResultPrefix) ? (string)__jsonResultPrefix : (string)ResultPrefix;} + {_lastStorageUpdate = If( json?.PropertyT("lastStorageUpdate"), out var __jsonLastStorageUpdate) ? global::System.DateTime.TryParse((string)__jsonLastStorageUpdate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastStorageUpdateValue) ? __jsonLastStorageUpdateValue : LastStorageUpdate : LastStorageUpdate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlOfflineTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectName.ToString()) : null, "objectName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._itemsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._itemsCount) : null, "itemsCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._itemsCompletedCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._itemsCompletedCount) : null, "itemsCompletedCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorPrefix.ToString()) : null, "errorPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resultPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultPrefix.ToString()) : null, "resultPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastStorageUpdate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastStorageUpdate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastStorageUpdate" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..d9fca053190a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.PowerShell.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskPropertiesTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlOfflineTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlOfflineTaskPropertiesTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..a11463ae46f8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlOfflineTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlOfflineTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.cs new file mode 100644 index 000000000000..a7f5cdecf68b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInput()); set => this._input = value; } + + /// Backing field for property. + private bool? _isCloneable; + + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsCloneable { get => this._isCloneable; set => this._isCloneable = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Backing field for property. + private string _taskId; + + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + public partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput Input { get; set; } + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether the task can be cloned or not", + SerializedName = @"isCloneable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput[] Output { get; } + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task id ", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + internal partial interface IMigrateMySqlAzureDbForMySqlOfflineTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskInput Input { get; set; } + /// whether the task can be cloned or not + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput[] Output { get; set; } + /// Task id + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.json.cs new file mode 100644 index 000000000000..6fd4aca8b6b3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations + /// + public partial class MigrateMySqlAzureDbForMySqlOfflineTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlOfflineTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlOfflineTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlOfflineTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_isCloneable = If( json?.PropertyT("isCloneable"), out var __jsonIsCloneable) ? (bool?)__jsonIsCloneable : IsCloneable;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlOfflineTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._isCloneable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isCloneable) : null, "isCloneable" ,container.Add ); + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..8aa5f263fd39 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.PowerShell.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Database specific information for MySQL to Azure Database for MySQL migration task inputs + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMapTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMapTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for MySQL to Azure Database for MySQL migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..fe5172d23b06 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.cs new file mode 100644 index 000000000000..35325862e70e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for MySQL to Azure Database for MySQL migration task inputs + /// + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting _migrationSetting; + + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting MigrationSetting { get => (this._migrationSetting = this._migrationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting()); set => this._migrationSetting = value; } + + /// Backing field for property. + private string _name; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting _sourceSetting; + + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting SourceSetting { get => (this._sourceSetting = this._sourceSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting()); set => this._sourceSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap _tableMap; + + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap TableMap { get => (this._tableMap = this._tableMap ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap()); set => this._tableMap = value; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting _targetSetting; + + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting TargetSetting { get => (this._targetSetting = this._targetSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting()); set => this._targetSetting = value; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput() + { + + } + } + /// Database specific information for MySQL to Azure Database for MySQL migration task inputs + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration settings which tune the migration behavior", + SerializedName = @"migrationSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source settings to tune source endpoint migration behavior", + SerializedName = @"sourceSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of source to target tables", + SerializedName = @"tableMap", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of target database. Note: Target database will be truncated before starting migration.", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target settings to tune target endpoint migration behavior", + SerializedName = @"targetSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } + /// Database specific information for MySQL to Azure Database for MySQL migration task inputs + internal partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputInternal + + { + /// Migration settings which tune the migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of the database + string Name { get; set; } + /// Source settings to tune source endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// Mapping of source to target tables + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.json.cs new file mode 100644 index 000000000000..d6d2f755f79e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for MySQL to Azure Database for MySQL migration task inputs + /// + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_migrationSetting = If( json?.PropertyT("migrationSetting"), out var __jsonMigrationSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.FromJson(__jsonMigrationSetting) : MigrationSetting;} + {_sourceSetting = If( json?.PropertyT("sourceSetting"), out var __jsonSourceSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.FromJson(__jsonSourceSetting) : SourceSetting;} + {_targetSetting = If( json?.PropertyT("targetSetting"), out var __jsonTargetSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.FromJson(__jsonTargetSetting) : TargetSetting;} + {_tableMap = If( json?.PropertyT("tableMap"), out var __jsonTableMap) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.FromJson(__jsonTableMap) : TableMap;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AddIf( null != this._migrationSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationSetting.ToJson(null,serializationMode) : null, "migrationSetting" ,container.Add ); + AddIf( null != this._sourceSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceSetting.ToJson(null,serializationMode) : null, "sourceSetting" ,container.Add ); + AddIf( null != this._targetSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetSetting.ToJson(null,serializationMode) : null, "targetSetting" ,container.Add ); + AddIf( null != this._tableMap ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tableMap.ToJson(null,serializationMode) : null, "tableMap" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.PowerShell.cs new file mode 100644 index 000000000000..421a7b519988 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSettingTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSettingTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.TypeConverter.cs new file mode 100644 index 000000000000..126e8007f1ef --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.cs new file mode 100644 index 000000000000..f6914721fdd5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting() + { + + } + } + /// Migration settings which tune the migration behavior + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Migration settings which tune the migration behavior + internal partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.dictionary.cs new file mode 100644 index 000000000000..2146a95d9d65 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.json.cs new file mode 100644 index 000000000000..8c4919163c44 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputMigrationSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.PowerShell.cs new file mode 100644 index 000000000000..a84d00e9ef0c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSettingTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSettingTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.TypeConverter.cs new file mode 100644 index 000000000000..ede87296f03a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.cs new file mode 100644 index 000000000000..9e3a35786716 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting() + { + + } + } + /// Source settings to tune source endpoint migration behavior + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Source settings to tune source endpoint migration behavior + internal partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.dictionary.cs new file mode 100644 index 000000000000..2ebaec1a2dbb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.json.cs new file mode 100644 index 000000000000..7a5a08ce0a3b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputSourceSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.PowerShell.cs new file mode 100644 index 000000000000..4ed5bcb457b0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMapTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMapTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.TypeConverter.cs new file mode 100644 index 000000000000..a27dec5f2d38 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMapTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.cs new file mode 100644 index 000000000000..2c0ed33e7f6f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMapInternal + { + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap() + { + + } + } + /// Mapping of source to target tables + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Mapping of source to target tables + internal partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMapInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.dictionary.cs new file mode 100644 index 000000000000..a73d8e596a0d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.json.cs new file mode 100644 index 000000000000..625f3675b069 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputTableMap(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.PowerShell.cs new file mode 100644 index 000000000000..a5e02c36e897 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSettingTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSettingTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.TypeConverter.cs new file mode 100644 index 000000000000..bd7a63d30dba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.cs new file mode 100644 index 000000000000..0bdf4f5e633a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting() + { + + } + } + /// Target settings to tune target endpoint migration behavior + public partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Target settings to tune target endpoint migration behavior + internal partial interface IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.dictionary.cs new file mode 100644 index 000000000000..b8c746888db5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.json.cs new file mode 100644 index 000000000000..08c30630ca8b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateMySqlAzureDbForMySqlSyncDatabaseInputTargetSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..b359eca361f6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.PowerShell.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskInputTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskInputTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..357868318f3a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.cs new file mode 100644 index 000000000000..4f5ae846b165 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source MySQL + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target Azure Database for MySQL + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).Port = value ; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskInput() + { + + } + } + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int SourceConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int TargetConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal + + { + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Connection information for source MySQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int SourceConnectionInfoPort { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Connection information for target Azure Database for MySQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int TargetConnectionInfoPort { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.json.cs new file mode 100644 index 000000000000..0b924bfbdf6b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..b8cd8646cf46 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..0ed9a6b77caa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.cs new file mode 100644 index 000000000000..e693755e9395 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskOutput() + { + + } + } + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..fefe6668b9f2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.json.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(json); + } + case "TableLevelOutput": + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(json); + } + case "ErrorOutput": + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputError(json); + } + case "DatabaseLevelErrorOutput": + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(json); + } + } + return new MigrateMySqlAzureDbForMySqlSyncTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.PowerShell.cs new file mode 100644 index 000000000000..483cea1da70a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.TypeConverter.cs new file mode 100644 index 000000000000..dc65dcdecf3b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.cs new file mode 100644 index 000000000000..cb2a52afb9d7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(); + + /// Backing field for property. + private string _errorMessage; + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] _event; + + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get => this._event; set => this._event = value; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput + { + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; set; } + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of error events.", + SerializedName = @"events", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal + { + /// Error message + string ErrorMessage { get; set; } + /// List of error events. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.json.cs new file mode 100644 index 000000000000..1b352e2ed1b6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(json); + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} + {_event = If( json?.PropertyT("events"), out var __jsonEvents) ? If( __jsonEvents as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEvent.FromJson(__u) )) ))() : null : Event;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput?.ToJson(container, serializationMode); + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + if (null != this._event) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._event ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("events",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..090c3f627360 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..5f0277010d00 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..90d7c092e95a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(); + + /// Backing field for property. + private long? _appliedChange; + + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? AppliedChange { get => this._appliedChange; } + + /// Backing field for property. + private long? _cdcDeleteCounter; + + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private long? _cdcInsertCounter; + + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private long? _cdcUpdateCounter; + + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private long? _fullLoadCompletedTable; + + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadCompletedTable { get => this._fullLoadCompletedTable; } + + /// Backing field for property. + private long? _fullLoadErroredTable; + + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadErroredTable { get => this._fullLoadErroredTable; } + + /// Backing field for property. + private long? _fullLoadLoadingTable; + + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadLoadingTable { get => this._fullLoadLoadingTable; } + + /// Backing field for property. + private long? _fullLoadQueuedTable; + + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadQueuedTable { get => this._fullLoadQueuedTable; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; } + + /// Backing field for property. + private long? _incomingChange; + + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? IncomingChange { get => this._incomingChange; } + + /// Backing field for property. + private bool? _initializationCompleted; + + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? InitializationCompleted { get => this._initializationCompleted; } + + /// Backing field for property. + private long? _latency; + + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Latency { get => this._latency; } + + /// Internal Acessors for AppliedChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.AppliedChange { get => this._appliedChange; set { {_appliedChange = value;} } } + + /// Internal Acessors for CdcDeleteCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for FullLoadCompletedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.FullLoadCompletedTable { get => this._fullLoadCompletedTable; set { {_fullLoadCompletedTable = value;} } } + + /// Internal Acessors for FullLoadErroredTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.FullLoadErroredTable { get => this._fullLoadErroredTable; set { {_fullLoadErroredTable = value;} } } + + /// Internal Acessors for FullLoadLoadingTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.FullLoadLoadingTable { get => this._fullLoadLoadingTable; set { {_fullLoadLoadingTable = value;} } } + + /// Internal Acessors for FullLoadQueuedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.FullLoadQueuedTable { get => this._fullLoadQueuedTable; set { {_fullLoadQueuedTable = value;} } } + + /// Internal Acessors for IncomingChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.IncomingChange { get => this._incomingChange; set { {_incomingChange = value;} } } + + /// Internal Acessors for InitializationCompleted + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.InitializationCompleted { get => this._initializationCompleted; set { {_initializationCompleted = value;} } } + + /// Internal Acessors for Latency + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.Latency { get => this._latency; set { {_latency = value;} } } + + /// Internal Acessors for MigrationState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? _migrationState; + + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get => this._migrationState; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput + { + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied changes", + SerializedName = @"appliedChanges", + PossibleTypes = new [] { typeof(long) })] + long? AppliedChange { get; } + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcDeleteCounter { get; } + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcInsertCounter { get; } + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcUpdateCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables completed in full load", + SerializedName = @"fullLoadCompletedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadCompletedTable { get; } + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables errored in full load", + SerializedName = @"fullLoadErroredTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadErroredTable { get; } + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables loading in full load", + SerializedName = @"fullLoadLoadingTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadLoadingTable { get; } + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables queued in full load", + SerializedName = @"fullLoadQueuedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadQueuedTable { get; } + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of incoming changes", + SerializedName = @"incomingChanges", + PossibleTypes = new [] { typeof(long) })] + long? IncomingChange { get; } + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if initial load (full load) has been completed", + SerializedName = @"initializationCompleted", + PossibleTypes = new [] { typeof(bool) })] + bool? InitializationCompleted { get; } + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"CDC apply latency", + SerializedName = @"latency", + PossibleTypes = new [] { typeof(long) })] + long? Latency { get; } + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration state that this database is in", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal + { + /// Number of applied changes + long? AppliedChange { get; set; } + /// Number of cdc deletes + long? CdcDeleteCounter { get; set; } + /// Number of cdc inserts + long? CdcInsertCounter { get; set; } + /// Number of cdc updates + long? CdcUpdateCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Number of tables completed in full load + long? FullLoadCompletedTable { get; set; } + /// Number of tables errored in full load + long? FullLoadErroredTable { get; set; } + /// Number of tables loading in full load + long? FullLoadLoadingTable { get; set; } + /// Number of tables queued in full load + long? FullLoadQueuedTable { get; set; } + /// Number of incoming changes + long? IncomingChange { get; set; } + /// Indicates if initial load (full load) has been completed + bool? InitializationCompleted { get; set; } + /// CDC apply latency + long? Latency { get; set; } + /// Migration state that this database is in + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..d74b26331d1c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + {_incomingChange = If( json?.PropertyT("incomingChanges"), out var __jsonIncomingChanges) ? (long?)__jsonIncomingChanges : IncomingChange;} + {_appliedChange = If( json?.PropertyT("appliedChanges"), out var __jsonAppliedChanges) ? (long?)__jsonAppliedChanges : AppliedChange;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (long?)__jsonCdcInsertCounter : CdcInsertCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (long?)__jsonCdcDeleteCounter : CdcDeleteCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (long?)__jsonCdcUpdateCounter : CdcUpdateCounter;} + {_fullLoadCompletedTable = If( json?.PropertyT("fullLoadCompletedTables"), out var __jsonFullLoadCompletedTables) ? (long?)__jsonFullLoadCompletedTables : FullLoadCompletedTable;} + {_fullLoadLoadingTable = If( json?.PropertyT("fullLoadLoadingTables"), out var __jsonFullLoadLoadingTables) ? (long?)__jsonFullLoadLoadingTables : FullLoadLoadingTable;} + {_fullLoadQueuedTable = If( json?.PropertyT("fullLoadQueuedTables"), out var __jsonFullLoadQueuedTables) ? (long?)__jsonFullLoadQueuedTables : FullLoadQueuedTable;} + {_fullLoadErroredTable = If( json?.PropertyT("fullLoadErroredTables"), out var __jsonFullLoadErroredTables) ? (long?)__jsonFullLoadErroredTables : FullLoadErroredTable;} + {_initializationCompleted = If( json?.PropertyT("initializationCompleted"), out var __jsonInitializationCompleted) ? (bool?)__jsonInitializationCompleted : InitializationCompleted;} + {_latency = If( json?.PropertyT("latency"), out var __jsonLatency) ? (long?)__jsonLatency : Latency;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._incomingChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._incomingChange) : null, "incomingChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._appliedChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._appliedChange) : null, "appliedChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcInsertCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcInsertCounter) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcDeleteCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcDeleteCounter) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcUpdateCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcUpdateCounter) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadCompletedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadCompletedTable) : null, "fullLoadCompletedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadLoadingTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadLoadingTable) : null, "fullLoadLoadingTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadQueuedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadQueuedTable) : null, "fullLoadQueuedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadErroredTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadErroredTable) : null, "fullLoadErroredTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._initializationCompleted ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._initializationCompleted) : null, "initializationCompleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._latency ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._latency) : null, "latency" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..377cf8794370 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..5cfc0ebaba56 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.cs new file mode 100644 index 000000000000..e642c89179a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.json.cs new file mode 100644 index 000000000000..3a3b73150449 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..9fda29338907 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..bf16c50ed926 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..ae3d054a4a90 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for SourceServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal.SourceServer { get => this._sourceServer; set { {_sourceServer = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for TargetServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal.TargetServer { get => this._targetServer; set { {_targetServer = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServer; + + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServer { get => this._sourceServer; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private string _targetServer; + + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServer { get => this._targetServer; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server name", + SerializedName = @"sourceServer", + PossibleTypes = new [] { typeof(string) })] + string SourceServer { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server name", + SerializedName = @"targetServer", + PossibleTypes = new [] { typeof(string) })] + string TargetServer { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Source server name + string SourceServer { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Target server name + string TargetServer { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..e76c2ee0afa5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.json.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(json); + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServer = If( json?.PropertyT("sourceServer"), out var __jsonSourceServer) ? (string)__jsonSourceServer : (string)SourceServer;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServer = If( json?.PropertyT("targetServer"), out var __jsonTargetServer) ? (string)__jsonTargetServer : (string)TargetServer;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServer.ToString()) : null, "sourceServer" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServer.ToString()) : null, "targetServer" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.PowerShell.cs new file mode 100644 index 000000000000..5892408f0fc9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.PowerShell.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (string) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, global::System.Convert.ToString); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (string) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, global::System.Convert.ToString); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (string) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, global::System.Convert.ToString); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (string) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, global::System.Convert.ToString); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (string) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, global::System.Convert.ToString); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (string) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, global::System.Convert.ToString); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.TypeConverter.cs new file mode 100644 index 000000000000..a0f79e26f56e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.cs new file mode 100644 index 000000000000..e2e58f75cdbd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.cs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(); + + /// Backing field for property. + private string _cdcDeleteCounter; + + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private string _cdcInsertCounter; + + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private string _cdcUpdateCounter; + + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private long? _dataErrorsCounter; + + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataErrorsCounter { get => this._dataErrorsCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEndedOn; + + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEndedOn { get => this._fullLoadEndedOn; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEstFinishTime; + + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadStartedOn; + + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadStartedOn { get => this._fullLoadStartedOn; } + + /// Backing field for property. + private long? _fullLoadTotalRow; + + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadTotalRow { get => this._fullLoadTotalRow; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).Id = value; } + + /// Internal Acessors for CdcDeleteCounter + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DataErrorsCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.DataErrorsCounter { get => this._dataErrorsCounter; set { {_dataErrorsCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for FullLoadEndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.FullLoadEndedOn { get => this._fullLoadEndedOn; set { {_fullLoadEndedOn = value;} } } + + /// Internal Acessors for FullLoadEstFinishTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; set { {_fullLoadEstFinishTime = value;} } } + + /// Internal Acessors for FullLoadStartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.FullLoadStartedOn { get => this._fullLoadStartedOn; set { {_fullLoadStartedOn = value;} } } + + /// Internal Acessors for FullLoadTotalRow + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.FullLoadTotalRow { get => this._fullLoadTotalRow; set { {_fullLoadTotalRow = value;} } } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for TableName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.TableName { get => this._tableName; set { {_tableName = value;} } } + + /// Internal Acessors for TotalChangesApplied + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal.TotalChangesApplied { get => this._totalChangesApplied; set { {_totalChangesApplied = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal)__migrateMySqlAzureDbForMySqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? _state; + + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get => this._state; } + + /// Backing field for property. + private string _tableName; + + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TableName { get => this._tableName; } + + /// Backing field for property. + private long? _totalChangesApplied; + + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? TotalChangesApplied { get => this._totalChangesApplied; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateMySqlAzureDbForMySqlSyncTaskOutput), __migrateMySqlAzureDbForMySqlSyncTaskOutput); + } + } + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput + { + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(string) })] + string CdcDeleteCounter { get; } + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(string) })] + string CdcInsertCounter { get; } + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(string) })] + string CdcUpdateCounter { get; } + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of data errors occurred", + SerializedName = @"dataErrorsCounter", + PossibleTypes = new [] { typeof(long) })] + long? DataErrorsCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load end time", + SerializedName = @"fullLoadEndedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEndedOn { get; } + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Estimate to finish full load", + SerializedName = @"fullLoadEstFinishTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEstFinishTime { get; } + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load start time", + SerializedName = @"fullLoadStartedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadStartedOn { get; } + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of rows applied in full load", + SerializedName = @"fullLoadTotalRows", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadTotalRow { get; } + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last modified time on target", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of the table migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; } + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the table", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string TableName { get; } + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of applied changes", + SerializedName = @"totalChangesApplied", + PossibleTypes = new [] { typeof(long) })] + long? TotalChangesApplied { get; } + + } + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputInternal + { + /// Number of applied deletes + string CdcDeleteCounter { get; set; } + /// Number of applied inserts + string CdcInsertCounter { get; set; } + /// Number of applied updates + string CdcUpdateCounter { get; set; } + /// Number of data errors occurred + long? DataErrorsCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Full load end time + global::System.DateTime? FullLoadEndedOn { get; set; } + /// Estimate to finish full load + global::System.DateTime? FullLoadEstFinishTime { get; set; } + /// Full load start time + global::System.DateTime? FullLoadStartedOn { get; set; } + /// Number of rows applied in full load + long? FullLoadTotalRow { get; set; } + /// Last modified time on target + global::System.DateTime? LastModifiedTime { get; set; } + /// Current state of the table migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; set; } + /// Name of the table + string TableName { get; set; } + /// Total number of applied changes + long? TotalChangesApplied { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.json.cs new file mode 100644 index 000000000000..8be7252a4d9d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.json.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput(json); + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (string)__jsonCdcInsertCounter : (string)CdcInsertCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (string)__jsonCdcUpdateCounter : (string)CdcUpdateCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (string)__jsonCdcDeleteCounter : (string)CdcDeleteCounter;} + {_fullLoadEstFinishTime = If( json?.PropertyT("fullLoadEstFinishTime"), out var __jsonFullLoadEstFinishTime) ? global::System.DateTime.TryParse((string)__jsonFullLoadEstFinishTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEstFinishTimeValue) ? __jsonFullLoadEstFinishTimeValue : FullLoadEstFinishTime : FullLoadEstFinishTime;} + {_fullLoadStartedOn = If( json?.PropertyT("fullLoadStartedOn"), out var __jsonFullLoadStartedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadStartedOnValue) ? __jsonFullLoadStartedOnValue : FullLoadStartedOn : FullLoadStartedOn;} + {_fullLoadEndedOn = If( json?.PropertyT("fullLoadEndedOn"), out var __jsonFullLoadEndedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEndedOnValue) ? __jsonFullLoadEndedOnValue : FullLoadEndedOn : FullLoadEndedOn;} + {_fullLoadTotalRow = If( json?.PropertyT("fullLoadTotalRows"), out var __jsonFullLoadTotalRows) ? (long?)__jsonFullLoadTotalRows : FullLoadTotalRow;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_totalChangesApplied = If( json?.PropertyT("totalChangesApplied"), out var __jsonTotalChangesApplied) ? (long?)__jsonTotalChangesApplied : TotalChangesApplied;} + {_dataErrorsCounter = If( json?.PropertyT("dataErrorsCounter"), out var __jsonDataErrorsCounter) ? (long?)__jsonDataErrorsCounter : DataErrorsCounter;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateMySqlAzureDbForMySqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tableName.ToString()) : null, "tableName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._cdcInsertCounter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._cdcInsertCounter.ToString()) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._cdcUpdateCounter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._cdcUpdateCounter.ToString()) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._cdcDeleteCounter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._cdcDeleteCounter.ToString()) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEstFinishTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEstFinishTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEstFinishTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadStartedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadStartedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadStartedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEndedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEndedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEndedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadTotalRow ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadTotalRow) : null, "fullLoadTotalRows" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalChangesApplied ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._totalChangesApplied) : null, "totalChangesApplied" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataErrorsCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataErrorsCounter) : null, "dataErrorsCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..28b7b7f7f5d3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskPropertiesTypeConverter))] + public partial class MigrateMySqlAzureDbForMySqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateMySqlAzureDbForMySqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateMySqlAzureDbForMySqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputSourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputSourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputTargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo) content.GetValueForProperty("InputTargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputTargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MySqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("InputSelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[]) content.GetValueForProperty("InputSelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).InputSelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateMySqlAzureDbForMySqlSyncTaskPropertiesTypeConverter))] + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..12fc1432cb0a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateMySqlAzureDbForMySqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateMySqlAzureDbForMySqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.cs new file mode 100644 index 000000000000..4cc406f9f33b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskInput()); set => this._input = value; } + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[] InputSelectedDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SelectedDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SelectedDatabase = value ?? null /* arrayOf */; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputSourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal.InputSourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfo = value; } + + /// Internal Acessors for InputTargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal.InputTargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfo = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput[] Output { get => this._output; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoPort = value ?? default(int); } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoServerName = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).SourceConnectionInfoUserName = value ?? null; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoDataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoPassword = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoPort = value ?? default(int); } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoServerName = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInputInternal)Input).TargetConnectionInfoUserName = value ?? null; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateMySqlAzureDbForMySqlSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + public partial interface IMigrateMySqlAzureDbForMySqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[] InputSelectedDatabase { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputError),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput[] Output { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + internal partial interface IMigrateMySqlAzureDbForMySqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskInput Input { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncDatabaseInput[] InputSelectedDatabase { get; set; } + /// Connection information for source MySQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo InputSourceConnectionInfo { get; set; } + /// Connection information for target Azure Database for MySQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo InputTargetConnectionInfo { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput[] Output { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..a3ab97ada68d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations + /// + public partial class MigrateMySqlAzureDbForMySqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateMySqlAzureDbForMySqlSyncTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateMySqlAzureDbForMySqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateMySqlAzureDbForMySqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateMySqlAzureDbForMySqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..0748d3d44e2c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial interface IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..e2fedafb760f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 000000000000..6d8a0b393eac --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations + public partial interface IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput[] Output { get; } + + } + /// Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations + internal partial interface IMigrateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..131ebc3d453d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbForPostgreSqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..922673e164ef --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.PowerShell.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs + /// + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CaseManipulation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).CaseManipulation = (string) content.GetValueForProperty("CaseManipulation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).CaseManipulation, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMapTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CaseManipulation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).CaseManipulation = (string) content.GetValueForProperty("CaseManipulation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).CaseManipulation, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMapTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..0f435a269d96 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.cs new file mode 100644 index 000000000000..c5cb74c10333 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal + { + + /// Backing field for property. + private string _caseManipulation; + + /// How to handle object name casing: either Preserve or ToLower + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CaseManipulation { get => this._caseManipulation; set => this._caseManipulation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting _migrationSetting; + + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting MigrationSetting { get => (this._migrationSetting = this._migrationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting()); set => this._migrationSetting = value; } + + /// Backing field for property. + private string _name; + + /// Name of the migration pipeline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _schemaName; + + /// Name of the source schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SchemaName { get => this._schemaName; set => this._schemaName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting _sourceSetting; + + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting SourceSetting { get => (this._sourceSetting = this._sourceSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting()); set => this._sourceSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap _tableMap; + + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap TableMap { get => (this._tableMap = this._tableMap ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap()); set => this._tableMap = value; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting _targetSetting; + + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting TargetSetting { get => (this._targetSetting = this._targetSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting()); set => this._targetSetting = value; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput() + { + + } + } + /// Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// How to handle object name casing: either Preserve or ToLower + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How to handle object name casing: either Preserve or ToLower", + SerializedName = @"caseManipulation", + PossibleTypes = new [] { typeof(string) })] + string CaseManipulation { get; set; } + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration settings which tune the migration behavior", + SerializedName = @"migrationSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of the migration pipeline + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the migration pipeline", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Name of the source schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source schema", + SerializedName = @"schemaName", + PossibleTypes = new [] { typeof(string) })] + string SchemaName { get; set; } + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source settings to tune source endpoint migration behavior", + SerializedName = @"sourceSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of source to target tables", + SerializedName = @"tableMap", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of target database. Note: Target database will be truncated before starting migration.", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target settings to tune target endpoint migration behavior", + SerializedName = @"targetSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } + /// Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputInternal + + { + /// How to handle object name casing: either Preserve or ToLower + string CaseManipulation { get; set; } + /// Migration settings which tune the migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of the migration pipeline + string Name { get; set; } + /// Name of the source schema + string SchemaName { get; set; } + /// Source settings to tune source endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// Mapping of source to target tables + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.json.cs new file mode 100644 index 000000000000..1f5e8158434f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_caseManipulation = If( json?.PropertyT("caseManipulation"), out var __jsonCaseManipulation) ? (string)__jsonCaseManipulation : (string)CaseManipulation;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_schemaName = If( json?.PropertyT("schemaName"), out var __jsonSchemaName) ? (string)__jsonSchemaName : (string)SchemaName;} + {_tableMap = If( json?.PropertyT("tableMap"), out var __jsonTableMap) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.FromJson(__jsonTableMap) : TableMap;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_migrationSetting = If( json?.PropertyT("migrationSetting"), out var __jsonMigrationSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.FromJson(__jsonMigrationSetting) : MigrationSetting;} + {_sourceSetting = If( json?.PropertyT("sourceSetting"), out var __jsonSourceSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.FromJson(__jsonSourceSetting) : SourceSetting;} + {_targetSetting = If( json?.PropertyT("targetSetting"), out var __jsonTargetSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.FromJson(__jsonTargetSetting) : TargetSetting;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._caseManipulation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._caseManipulation.ToString()) : null, "caseManipulation" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._schemaName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._schemaName.ToString()) : null, "schemaName" ,container.Add ); + AddIf( null != this._tableMap ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tableMap.ToJson(null,serializationMode) : null, "tableMap" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AddIf( null != this._migrationSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationSetting.ToJson(null,serializationMode) : null, "migrationSetting" ,container.Add ); + AddIf( null != this._sourceSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceSetting.ToJson(null,serializationMode) : null, "sourceSetting" ,container.Add ); + AddIf( null != this._targetSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetSetting.ToJson(null,serializationMode) : null, "targetSetting" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.PowerShell.cs new file mode 100644 index 000000000000..b98aea60ddbd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.TypeConverter.cs new file mode 100644 index 000000000000..06553a72b8c3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.cs new file mode 100644 index 000000000000..56aaf7b17aa3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting() + { + + } + } + /// Migration settings which tune the migration behavior + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Migration settings which tune the migration behavior + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.dictionary.cs new file mode 100644 index 000000000000..338e9993e9e9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.json.cs new file mode 100644 index 000000000000..30f22fee2de8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputMigrationSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.PowerShell.cs new file mode 100644 index 000000000000..c567b19f4b17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSettingTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSettingTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.TypeConverter.cs new file mode 100644 index 000000000000..d111f86c3b66 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.cs new file mode 100644 index 000000000000..1c42129b6ee5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting() + { + + } + } + /// Source settings to tune source endpoint migration behavior + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Source settings to tune source endpoint migration behavior + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.dictionary.cs new file mode 100644 index 000000000000..4913cee43583 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.json.cs new file mode 100644 index 000000000000..54c6af2df4c4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputSourceSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.PowerShell.cs new file mode 100644 index 000000000000..64cd6b694549 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMapTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMapTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.TypeConverter.cs new file mode 100644 index 000000000000..b66d8cf1f2d5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMapTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.cs new file mode 100644 index 000000000000..1681fc5b2647 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMapInternal + { + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap() + { + + } + } + /// Mapping of source to target tables + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Mapping of source to target tables + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMapInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.dictionary.cs new file mode 100644 index 000000000000..e0c70e01e3e5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.json.cs new file mode 100644 index 000000000000..d4caf1233849 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTableMap(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.PowerShell.cs new file mode 100644 index 000000000000..e12bea66df7e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSettingTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSettingTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.TypeConverter.cs new file mode 100644 index 000000000000..c325bb246063 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.cs new file mode 100644 index 000000000000..09101499703a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting() + { + + } + } + /// Target settings to tune target endpoint migration behavior + public partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Target settings to tune target endpoint migration behavior + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.dictionary.cs new file mode 100644 index 000000000000..e4de1eb1139c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.json.cs new file mode 100644 index 000000000000..2019a6e20743 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTargetSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..60ee44fe4b72 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.PowerShell.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskInputTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskInputTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..bb3c8faeec49 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.cs new file mode 100644 index 000000000000..afc005e9d2f8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.cs @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo _sourceConnectionInfo; + + /// Connection information for source Oracle + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target Azure Database for PostgreSQL + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskInput() + { + + } + } + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"EZConnect or TNSName connection string.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int TargetConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskInputInternal + + { + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Connection information for source Oracle + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo SourceConnectionInfo { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// EZConnect or TNSName connection string. + string SourceConnectionInfoDataSource { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// port for server + int? SourceConnectionInfoPort { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Connection information for target Azure Database for PostgreSQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int TargetConnectionInfoPort { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.json.cs new file mode 100644 index 000000000000..57c191e4330e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskInput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OracleConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..c146ac27bf68 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..54e7910baf0b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.cs new file mode 100644 index 000000000000..feaf7155a7e2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutput() + { + + } + } + /// Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..e0d4f3976fc3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.json.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(json); + } + case "TableLevelOutput": + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(json); + } + case "ErrorOutput": + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(json); + } + case "DatabaseLevelErrorOutput": + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(json); + } + } + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.PowerShell.cs new file mode 100644 index 000000000000..b1fe465dbb75 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.TypeConverter.cs new file mode 100644 index 000000000000..bcab853cdb2e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.cs new file mode 100644 index 000000000000..524b1a521537 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private string _errorMessage; + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] _event; + + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get => this._event; set => this._event = value; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; set; } + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of error events.", + SerializedName = @"events", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal + { + /// Error message + string ErrorMessage { get; set; } + /// List of error events. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.json.cs new file mode 100644 index 000000000000..8fcf85ef4af0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(json); + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} + {_event = If( json?.PropertyT("events"), out var __jsonEvents) ? If( __jsonEvents as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEvent.FromJson(__u) )) ))() : null : Event;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + if (null != this._event) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._event ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("events",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..ce6f63a3024a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..0d8b9e59a628 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..362d32568772 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private long? _appliedChange; + + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? AppliedChange { get => this._appliedChange; } + + /// Backing field for property. + private long? _cdcDeleteCounter; + + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private long? _cdcInsertCounter; + + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private long? _cdcUpdateCounter; + + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private long? _fullLoadCompletedTable; + + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadCompletedTable { get => this._fullLoadCompletedTable; } + + /// Backing field for property. + private long? _fullLoadErroredTable; + + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadErroredTable { get => this._fullLoadErroredTable; } + + /// Backing field for property. + private long? _fullLoadLoadingTable; + + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadLoadingTable { get => this._fullLoadLoadingTable; } + + /// Backing field for property. + private long? _fullLoadQueuedTable; + + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadQueuedTable { get => this._fullLoadQueuedTable; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; } + + /// Backing field for property. + private long? _incomingChange; + + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? IncomingChange { get => this._incomingChange; } + + /// Backing field for property. + private bool? _initializationCompleted; + + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? InitializationCompleted { get => this._initializationCompleted; } + + /// Backing field for property. + private long? _latency; + + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Latency { get => this._latency; } + + /// Internal Acessors for AppliedChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.AppliedChange { get => this._appliedChange; set { {_appliedChange = value;} } } + + /// Internal Acessors for CdcDeleteCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for FullLoadCompletedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadCompletedTable { get => this._fullLoadCompletedTable; set { {_fullLoadCompletedTable = value;} } } + + /// Internal Acessors for FullLoadErroredTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadErroredTable { get => this._fullLoadErroredTable; set { {_fullLoadErroredTable = value;} } } + + /// Internal Acessors for FullLoadLoadingTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadLoadingTable { get => this._fullLoadLoadingTable; set { {_fullLoadLoadingTable = value;} } } + + /// Internal Acessors for FullLoadQueuedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadQueuedTable { get => this._fullLoadQueuedTable; set { {_fullLoadQueuedTable = value;} } } + + /// Internal Acessors for IncomingChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.IncomingChange { get => this._incomingChange; set { {_incomingChange = value;} } } + + /// Internal Acessors for InitializationCompleted + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.InitializationCompleted { get => this._initializationCompleted; set { {_initializationCompleted = value;} } } + + /// Internal Acessors for Latency + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.Latency { get => this._latency; set { {_latency = value;} } } + + /// Internal Acessors for MigrationState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? _migrationState; + + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get => this._migrationState; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied changes", + SerializedName = @"appliedChanges", + PossibleTypes = new [] { typeof(long) })] + long? AppliedChange { get; } + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcDeleteCounter { get; } + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcInsertCounter { get; } + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcUpdateCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables completed in full load", + SerializedName = @"fullLoadCompletedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadCompletedTable { get; } + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables errored in full load", + SerializedName = @"fullLoadErroredTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadErroredTable { get; } + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables loading in full load", + SerializedName = @"fullLoadLoadingTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadLoadingTable { get; } + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables queued in full load", + SerializedName = @"fullLoadQueuedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadQueuedTable { get; } + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of incoming changes", + SerializedName = @"incomingChanges", + PossibleTypes = new [] { typeof(long) })] + long? IncomingChange { get; } + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if initial load (full load) has been completed", + SerializedName = @"initializationCompleted", + PossibleTypes = new [] { typeof(bool) })] + bool? InitializationCompleted { get; } + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"CDC apply latency", + SerializedName = @"latency", + PossibleTypes = new [] { typeof(long) })] + long? Latency { get; } + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration state that this database is in", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + } + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal + { + /// Number of applied changes + long? AppliedChange { get; set; } + /// Number of cdc deletes + long? CdcDeleteCounter { get; set; } + /// Number of cdc inserts + long? CdcInsertCounter { get; set; } + /// Number of cdc updates + long? CdcUpdateCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Number of tables completed in full load + long? FullLoadCompletedTable { get; set; } + /// Number of tables errored in full load + long? FullLoadErroredTable { get; set; } + /// Number of tables loading in full load + long? FullLoadLoadingTable { get; set; } + /// Number of tables queued in full load + long? FullLoadQueuedTable { get; set; } + /// Number of incoming changes + long? IncomingChange { get; set; } + /// Indicates if initial load (full load) has been completed + bool? InitializationCompleted { get; set; } + /// CDC apply latency + long? Latency { get; set; } + /// Migration state that this database is in + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..4f16c5d1da48 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + {_incomingChange = If( json?.PropertyT("incomingChanges"), out var __jsonIncomingChanges) ? (long?)__jsonIncomingChanges : IncomingChange;} + {_appliedChange = If( json?.PropertyT("appliedChanges"), out var __jsonAppliedChanges) ? (long?)__jsonAppliedChanges : AppliedChange;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (long?)__jsonCdcInsertCounter : CdcInsertCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (long?)__jsonCdcDeleteCounter : CdcDeleteCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (long?)__jsonCdcUpdateCounter : CdcUpdateCounter;} + {_fullLoadCompletedTable = If( json?.PropertyT("fullLoadCompletedTables"), out var __jsonFullLoadCompletedTables) ? (long?)__jsonFullLoadCompletedTables : FullLoadCompletedTable;} + {_fullLoadLoadingTable = If( json?.PropertyT("fullLoadLoadingTables"), out var __jsonFullLoadLoadingTables) ? (long?)__jsonFullLoadLoadingTables : FullLoadLoadingTable;} + {_fullLoadQueuedTable = If( json?.PropertyT("fullLoadQueuedTables"), out var __jsonFullLoadQueuedTables) ? (long?)__jsonFullLoadQueuedTables : FullLoadQueuedTable;} + {_fullLoadErroredTable = If( json?.PropertyT("fullLoadErroredTables"), out var __jsonFullLoadErroredTables) ? (long?)__jsonFullLoadErroredTables : FullLoadErroredTable;} + {_initializationCompleted = If( json?.PropertyT("initializationCompleted"), out var __jsonInitializationCompleted) ? (bool?)__jsonInitializationCompleted : InitializationCompleted;} + {_latency = If( json?.PropertyT("latency"), out var __jsonLatency) ? (long?)__jsonLatency : Latency;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._incomingChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._incomingChange) : null, "incomingChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._appliedChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._appliedChange) : null, "appliedChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcInsertCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcInsertCounter) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcDeleteCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcDeleteCounter) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcUpdateCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcUpdateCounter) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadCompletedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadCompletedTable) : null, "fullLoadCompletedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadLoadingTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadLoadingTable) : null, "fullLoadLoadingTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadQueuedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadQueuedTable) : null, "fullLoadQueuedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadErroredTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadErroredTable) : null, "fullLoadErroredTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._initializationCompleted ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._initializationCompleted) : null, "initializationCompleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._latency ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._latency) : null, "latency" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..02d8f297f77a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..ad8b87d66b17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.cs new file mode 100644 index 000000000000..4ae2c1aeda65 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.json.cs new file mode 100644 index 000000000000..575876927c41 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..818587bb8165 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..26123c8f6ff5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..8bea390d19ef --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for SourceServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal.SourceServer { get => this._sourceServer; set { {_sourceServer = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for TargetServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal.TargetServer { get => this._targetServer; set { {_targetServer = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServer; + + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServer { get => this._sourceServer; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private string _targetServer; + + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServer { get => this._targetServer; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server name", + SerializedName = @"sourceServer", + PossibleTypes = new [] { typeof(string) })] + string SourceServer { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server name", + SerializedName = @"targetServer", + PossibleTypes = new [] { typeof(string) })] + string TargetServer { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Source server name + string SourceServer { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Target server name + string TargetServer { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..ec5b2fb8ee44 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.json.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(json); + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServer = If( json?.PropertyT("sourceServer"), out var __jsonSourceServer) ? (string)__jsonSourceServer : (string)SourceServer;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServer = If( json?.PropertyT("targetServer"), out var __jsonTargetServer) ? (string)__jsonTargetServer : (string)TargetServer;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServer.ToString()) : null, "sourceServer" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServer.ToString()) : null, "targetServer" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.PowerShell.cs new file mode 100644 index 000000000000..2831ed9a40a3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.PowerShell.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelTypeConverter))] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelTypeConverter))] + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.TypeConverter.cs new file mode 100644 index 000000000000..ba986e83a001 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cs new file mode 100644 index 000000000000..ff7014db2741 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private long? _cdcDeleteCounter; + + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private long? _cdcInsertCounter; + + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private long? _cdcUpdateCounter; + + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private long? _dataErrorsCounter; + + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataErrorsCounter { get => this._dataErrorsCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEndedOn; + + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEndedOn { get => this._fullLoadEndedOn; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEstFinishTime; + + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadStartedOn; + + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadStartedOn { get => this._fullLoadStartedOn; } + + /// Backing field for property. + private long? _fullLoadTotalRow; + + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadTotalRow { get => this._fullLoadTotalRow; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).Id = value; } + + /// Internal Acessors for CdcDeleteCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DataErrorsCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.DataErrorsCounter { get => this._dataErrorsCounter; set { {_dataErrorsCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for FullLoadEndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadEndedOn { get => this._fullLoadEndedOn; set { {_fullLoadEndedOn = value;} } } + + /// Internal Acessors for FullLoadEstFinishTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; set { {_fullLoadEstFinishTime = value;} } } + + /// Internal Acessors for FullLoadStartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadStartedOn { get => this._fullLoadStartedOn; set { {_fullLoadStartedOn = value;} } } + + /// Internal Acessors for FullLoadTotalRow + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadTotalRow { get => this._fullLoadTotalRow; set { {_fullLoadTotalRow = value;} } } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for TableName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.TableName { get => this._tableName; set { {_tableName = value;} } } + + /// Internal Acessors for TotalChangesApplied + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal.TotalChangesApplied { get => this._totalChangesApplied; set { {_totalChangesApplied = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal)__migrateOracleAzureDbPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? _state; + + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get => this._state; } + + /// Backing field for property. + private string _tableName; + + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TableName { get => this._tableName; } + + /// Backing field for property. + private long? _totalChangesApplied; + + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? TotalChangesApplied { get => this._totalChangesApplied; } + + /// + /// Creates an new instance. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateOracleAzureDbPostgreSqlSyncTaskOutput), __migrateOracleAzureDbPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcDeleteCounter { get; } + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcInsertCounter { get; } + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcUpdateCounter { get; } + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of data errors occurred", + SerializedName = @"dataErrorsCounter", + PossibleTypes = new [] { typeof(long) })] + long? DataErrorsCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load end time", + SerializedName = @"fullLoadEndedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEndedOn { get; } + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Estimate to finish full load", + SerializedName = @"fullLoadEstFinishTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEstFinishTime { get; } + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load start time", + SerializedName = @"fullLoadStartedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadStartedOn { get; } + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of rows applied in full load", + SerializedName = @"fullLoadTotalRows", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadTotalRow { get; } + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last modified time on target", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of the table migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; } + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the table", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string TableName { get; } + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of applied changes", + SerializedName = @"totalChangesApplied", + PossibleTypes = new [] { typeof(long) })] + long? TotalChangesApplied { get; } + + } + internal partial interface IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputInternal + { + /// Number of applied deletes + long? CdcDeleteCounter { get; set; } + /// Number of applied inserts + long? CdcInsertCounter { get; set; } + /// Number of applied updates + long? CdcUpdateCounter { get; set; } + /// Number of data errors occurred + long? DataErrorsCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Full load end time + global::System.DateTime? FullLoadEndedOn { get; set; } + /// Estimate to finish full load + global::System.DateTime? FullLoadEstFinishTime { get; set; } + /// Full load start time + global::System.DateTime? FullLoadStartedOn { get; set; } + /// Number of rows applied in full load + long? FullLoadTotalRow { get; set; } + /// Last modified time on target + global::System.DateTime? LastModifiedTime { get; set; } + /// Current state of the table migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; set; } + /// Name of the table + string TableName { get; set; } + /// Total number of applied changes + long? TotalChangesApplied { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.json.cs new file mode 100644 index 000000000000..7bf41eae1263 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.json.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskOutput(json); + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (long?)__jsonCdcInsertCounter : CdcInsertCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (long?)__jsonCdcUpdateCounter : CdcUpdateCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (long?)__jsonCdcDeleteCounter : CdcDeleteCounter;} + {_fullLoadEstFinishTime = If( json?.PropertyT("fullLoadEstFinishTime"), out var __jsonFullLoadEstFinishTime) ? global::System.DateTime.TryParse((string)__jsonFullLoadEstFinishTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEstFinishTimeValue) ? __jsonFullLoadEstFinishTimeValue : FullLoadEstFinishTime : FullLoadEstFinishTime;} + {_fullLoadStartedOn = If( json?.PropertyT("fullLoadStartedOn"), out var __jsonFullLoadStartedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadStartedOnValue) ? __jsonFullLoadStartedOnValue : FullLoadStartedOn : FullLoadStartedOn;} + {_fullLoadEndedOn = If( json?.PropertyT("fullLoadEndedOn"), out var __jsonFullLoadEndedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEndedOnValue) ? __jsonFullLoadEndedOnValue : FullLoadEndedOn : FullLoadEndedOn;} + {_fullLoadTotalRow = If( json?.PropertyT("fullLoadTotalRows"), out var __jsonFullLoadTotalRows) ? (long?)__jsonFullLoadTotalRows : FullLoadTotalRow;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_totalChangesApplied = If( json?.PropertyT("totalChangesApplied"), out var __jsonTotalChangesApplied) ? (long?)__jsonTotalChangesApplied : TotalChangesApplied;} + {_dataErrorsCounter = If( json?.PropertyT("dataErrorsCounter"), out var __jsonDataErrorsCounter) ? (long?)__jsonDataErrorsCounter : DataErrorsCounter;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateOracleAzureDbPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tableName.ToString()) : null, "tableName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcInsertCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcInsertCounter) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcUpdateCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcUpdateCounter) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcDeleteCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcDeleteCounter) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEstFinishTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEstFinishTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEstFinishTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadStartedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadStartedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadStartedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEndedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEndedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEndedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadTotalRow ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadTotalRow) : null, "fullLoadTotalRows" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalChangesApplied ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._totalChangesApplied) : null, "totalChangesApplied" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataErrorsCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataErrorsCounter) : null, "dataErrorsCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..bae7d89528c0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs + /// + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SelectedTable = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput[]) content.GetValueForProperty("SelectedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SelectedTable, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SelectedTable = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput[]) content.GetValueForProperty("SelectedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal)this).SelectedTable, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..a65d2ed48b03 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.cs new file mode 100644 index 000000000000..7b5a4d4075ad --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting _migrationSetting; + + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting MigrationSetting { get => (this._migrationSetting = this._migrationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting()); set => this._migrationSetting = value; } + + /// Backing field for property. + private string _name; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput[] _selectedTable; + + /// Tables selected for migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput[] SelectedTable { get => this._selectedTable; set => this._selectedTable = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting _sourceSetting; + + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting SourceSetting { get => (this._sourceSetting = this._sourceSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting()); set => this._sourceSetting = value; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting _targetSetting; + + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting TargetSetting { get => (this._targetSetting = this._targetSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting()); set => this._targetSetting = value; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput() + { + + } + } + /// Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration settings which tune the migration behavior", + SerializedName = @"migrationSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Tables selected for migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tables selected for migration", + SerializedName = @"selectedTables", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput[] SelectedTable { get; set; } + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source settings to tune source endpoint migration behavior", + SerializedName = @"sourceSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of target database. Note: Target database will be truncated before starting migration.", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target settings to tune target endpoint migration behavior", + SerializedName = @"targetSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } + /// Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputInternal + + { + /// Result identifier + string Id { get; set; } + /// Migration settings which tune the migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of the database + string Name { get; set; } + /// Tables selected for migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput[] SelectedTable { get; set; } + /// Source settings to tune source endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.json.cs new file mode 100644 index 000000000000..d942290f3de0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.json.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_migrationSetting = If( json?.PropertyT("migrationSetting"), out var __jsonMigrationSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.FromJson(__jsonMigrationSetting) : MigrationSetting;} + {_sourceSetting = If( json?.PropertyT("sourceSetting"), out var __jsonSourceSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.FromJson(__jsonSourceSetting) : SourceSetting;} + {_targetSetting = If( json?.PropertyT("targetSetting"), out var __jsonTargetSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.FromJson(__jsonTargetSetting) : TargetSetting;} + {_selectedTable = If( json?.PropertyT("selectedTables"), out var __jsonSelectedTables) ? If( __jsonSelectedTables as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.FromJson(__u) )) ))() : null : SelectedTable;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AddIf( null != this._migrationSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationSetting.ToJson(null,serializationMode) : null, "migrationSetting" ,container.Add ); + AddIf( null != this._sourceSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceSetting.ToJson(null,serializationMode) : null, "sourceSetting" ,container.Add ); + AddIf( null != this._targetSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetSetting.ToJson(null,serializationMode) : null, "targetSetting" ,container.Add ); + if (null != this._selectedTable) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedTable ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedTables",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.PowerShell.cs new file mode 100644 index 000000000000..b1df43c6a1e8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.TypeConverter.cs new file mode 100644 index 000000000000..4c8c26c87b3b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if + /// there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if + /// there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.cs new file mode 100644 index 000000000000..01903ab24957 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting() + { + + } + } + /// Migration settings which tune the migration behavior + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Migration settings which tune the migration behavior + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.dictionary.cs new file mode 100644 index 000000000000..00ab3c3c809a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.json.cs new file mode 100644 index 000000000000..26cc671fde38 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputMigrationSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into + /// a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.PowerShell.cs new file mode 100644 index 000000000000..d181cd3ce30a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSettingTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSettingTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.TypeConverter.cs new file mode 100644 index 000000000000..888b02c16a9d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.cs new file mode 100644 index 000000000000..bb54365bbd05 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting() + { + + } + } + /// Source settings to tune source endpoint migration behavior + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Source settings to tune source endpoint migration behavior + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.dictionary.cs new file mode 100644 index 000000000000..443b66cdce3c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.json.cs new file mode 100644 index 000000000000..66d1dbc5bf40 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputSourceSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a + /// . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.PowerShell.cs new file mode 100644 index 000000000000..4be2ce1d87e3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSettingTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSettingTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.TypeConverter.cs new file mode 100644 index 000000000000..f6a00810fc2c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.cs new file mode 100644 index 000000000000..73c672124b3d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting() + { + + } + } + /// Target settings to tune target endpoint migration behavior + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Target settings to tune target endpoint migration behavior + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.dictionary.cs new file mode 100644 index 000000000000..59b1705933fe --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.json.cs new file mode 100644 index 000000000000..e41baa9098f4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTargetSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a + /// . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.PowerShell.cs new file mode 100644 index 000000000000..eecf28c4cee2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.PowerShell.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Selected tables for the migration + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Selected tables for the migration + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.TypeConverter.cs new file mode 100644 index 000000000000..218fb5d791d8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.cs new file mode 100644 index 000000000000..7b0f9e51e574 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Selected tables for the migration + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputInternal + { + + /// Backing field for property. + private string _name; + + /// Name of the table to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput() + { + + } + } + /// Selected tables for the migration + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the table to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the table to migrate", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Selected tables for the migration + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInputInternal + + { + /// Name of the table to migrate + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.json.cs new file mode 100644 index 000000000000..72d4717c91fb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Selected tables for the migration + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..5bdeded17450 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.PowerShell.cs @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName = (string) content.GetValueForProperty("TargetConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort = (int) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName = (string) content.GetValueForProperty("SourceConnectionInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort = (int) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..f9241fb50017 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.cs new file mode 100644 index 000000000000..3e3df7eea323 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.cs @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal + { + + /// Backing field for property. + private string _encryptedKeyForSecureField; + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EncryptedKeyForSecureField { get => this._encryptedKeyForSecureField; set => this._encryptedKeyForSecureField = value; } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source PostgreSQL + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo _targetConnectionInfo; + + /// Connection information for target Azure Database for PostgreSQL + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ?? null; } + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).DatabaseName = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).Port = value ; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput() + { + + } + } + /// Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string EncryptedKeyForSecureField { get; set; } + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int SourceConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int TargetConnectionInfoPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputInternal + + { + /// encrypted key for secure fields + string EncryptedKeyForSecureField { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Connection information for source PostgreSQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source + string SourceConnectionInfoDataSource { get; set; } + /// Name of the database + string SourceConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Port for Server + int SourceConnectionInfoPort { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Connection information for target Azure Database for PostgreSQL + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source + string TargetConnectionInfoDataSource { get; set; } + /// Name of the database + string TargetConnectionInfoDatabaseName { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Port for Server + int TargetConnectionInfoPort { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// Name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.json.cs new file mode 100644 index 000000000000..2b8256f176c8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.PostgreSqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + {_encryptedKeyForSecureField = If( json?.PropertyT("encryptedKeyForSecureFields"), out var __jsonEncryptedKeyForSecureFields) ? (string)__jsonEncryptedKeyForSecureFields : (string)EncryptedKeyForSecureField;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AddIf( null != (((object)this._encryptedKeyForSecureField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._encryptedKeyForSecureField.ToString()) : null, "encryptedKeyForSecureFields" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..9ec780b49ff3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..3b823a5d7f1e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.cs new file mode 100644 index 000000000000..bd2053e3fe36 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() + { + + } + } + /// Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..49be129c6423 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.json.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(json); + } + case "TableLevelOutput": + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(json); + } + case "ErrorOutput": + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(json); + } + case "DatabaseLevelErrorOutput": + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(json); + } + } + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.PowerShell.cs new file mode 100644 index 000000000000..b644943a8d65 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.TypeConverter.cs new file mode 100644 index 000000000000..bcecfaef87aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.cs new file mode 100644 index 000000000000..e3668b919ce3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private string _errorMessage; + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] _event; + + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get => this._event; set => this._event = value; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + { + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; set; } + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of error events.", + SerializedName = @"events", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal + { + /// Error message + string ErrorMessage { get; set; } + /// List of error events. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.json.cs new file mode 100644 index 000000000000..9fd38622f5fb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(json); + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} + {_event = If( json?.PropertyT("events"), out var __jsonEvents) ? If( __jsonEvents as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEvent.FromJson(__u) )) ))() : null : Event;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + if (null != this._event) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._event ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("events",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..254290fb2076 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..c1da6f9e0ad1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..1a15bb9bcaac --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private long? _appliedChange; + + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? AppliedChange { get => this._appliedChange; } + + /// Backing field for property. + private long? _cdcDeleteCounter; + + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private long? _cdcInsertCounter; + + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private long? _cdcUpdateCounter; + + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private long? _fullLoadCompletedTable; + + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadCompletedTable { get => this._fullLoadCompletedTable; } + + /// Backing field for property. + private long? _fullLoadErroredTable; + + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadErroredTable { get => this._fullLoadErroredTable; } + + /// Backing field for property. + private long? _fullLoadLoadingTable; + + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadLoadingTable { get => this._fullLoadLoadingTable; } + + /// Backing field for property. + private long? _fullLoadQueuedTable; + + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadQueuedTable { get => this._fullLoadQueuedTable; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; } + + /// Backing field for property. + private long? _incomingChange; + + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? IncomingChange { get => this._incomingChange; } + + /// Backing field for property. + private bool? _initializationCompleted; + + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? InitializationCompleted { get => this._initializationCompleted; } + + /// Backing field for property. + private long? _latency; + + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Latency { get => this._latency; } + + /// Internal Acessors for AppliedChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.AppliedChange { get => this._appliedChange; set { {_appliedChange = value;} } } + + /// Internal Acessors for CdcDeleteCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for FullLoadCompletedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadCompletedTable { get => this._fullLoadCompletedTable; set { {_fullLoadCompletedTable = value;} } } + + /// Internal Acessors for FullLoadErroredTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadErroredTable { get => this._fullLoadErroredTable; set { {_fullLoadErroredTable = value;} } } + + /// Internal Acessors for FullLoadLoadingTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadLoadingTable { get => this._fullLoadLoadingTable; set { {_fullLoadLoadingTable = value;} } } + + /// Internal Acessors for FullLoadQueuedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.FullLoadQueuedTable { get => this._fullLoadQueuedTable; set { {_fullLoadQueuedTable = value;} } } + + /// Internal Acessors for IncomingChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.IncomingChange { get => this._incomingChange; set { {_incomingChange = value;} } } + + /// Internal Acessors for InitializationCompleted + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.InitializationCompleted { get => this._initializationCompleted; set { {_initializationCompleted = value;} } } + + /// Internal Acessors for Latency + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.Latency { get => this._latency; set { {_latency = value;} } } + + /// Internal Acessors for MigrationState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? _migrationState; + + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get => this._migrationState; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + { + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied changes", + SerializedName = @"appliedChanges", + PossibleTypes = new [] { typeof(long) })] + long? AppliedChange { get; } + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcDeleteCounter { get; } + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcInsertCounter { get; } + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcUpdateCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables completed in full load", + SerializedName = @"fullLoadCompletedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadCompletedTable { get; } + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables errored in full load", + SerializedName = @"fullLoadErroredTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadErroredTable { get; } + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables loading in full load", + SerializedName = @"fullLoadLoadingTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadLoadingTable { get; } + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables queued in full load", + SerializedName = @"fullLoadQueuedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadQueuedTable { get; } + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of incoming changes", + SerializedName = @"incomingChanges", + PossibleTypes = new [] { typeof(long) })] + long? IncomingChange { get; } + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if initial load (full load) has been completed", + SerializedName = @"initializationCompleted", + PossibleTypes = new [] { typeof(bool) })] + bool? InitializationCompleted { get; } + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"CDC apply latency", + SerializedName = @"latency", + PossibleTypes = new [] { typeof(long) })] + long? Latency { get; } + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration state that this database is in", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + } + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal + { + /// Number of applied changes + long? AppliedChange { get; set; } + /// Number of cdc deletes + long? CdcDeleteCounter { get; set; } + /// Number of cdc inserts + long? CdcInsertCounter { get; set; } + /// Number of cdc updates + long? CdcUpdateCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Number of tables completed in full load + long? FullLoadCompletedTable { get; set; } + /// Number of tables errored in full load + long? FullLoadErroredTable { get; set; } + /// Number of tables loading in full load + long? FullLoadLoadingTable { get; set; } + /// Number of tables queued in full load + long? FullLoadQueuedTable { get; set; } + /// Number of incoming changes + long? IncomingChange { get; set; } + /// Indicates if initial load (full load) has been completed + bool? InitializationCompleted { get; set; } + /// CDC apply latency + long? Latency { get; set; } + /// Migration state that this database is in + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..0c10bf557911 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + {_incomingChange = If( json?.PropertyT("incomingChanges"), out var __jsonIncomingChanges) ? (long?)__jsonIncomingChanges : IncomingChange;} + {_appliedChange = If( json?.PropertyT("appliedChanges"), out var __jsonAppliedChanges) ? (long?)__jsonAppliedChanges : AppliedChange;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (long?)__jsonCdcInsertCounter : CdcInsertCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (long?)__jsonCdcDeleteCounter : CdcDeleteCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (long?)__jsonCdcUpdateCounter : CdcUpdateCounter;} + {_fullLoadCompletedTable = If( json?.PropertyT("fullLoadCompletedTables"), out var __jsonFullLoadCompletedTables) ? (long?)__jsonFullLoadCompletedTables : FullLoadCompletedTable;} + {_fullLoadLoadingTable = If( json?.PropertyT("fullLoadLoadingTables"), out var __jsonFullLoadLoadingTables) ? (long?)__jsonFullLoadLoadingTables : FullLoadLoadingTable;} + {_fullLoadQueuedTable = If( json?.PropertyT("fullLoadQueuedTables"), out var __jsonFullLoadQueuedTables) ? (long?)__jsonFullLoadQueuedTables : FullLoadQueuedTable;} + {_fullLoadErroredTable = If( json?.PropertyT("fullLoadErroredTables"), out var __jsonFullLoadErroredTables) ? (long?)__jsonFullLoadErroredTables : FullLoadErroredTable;} + {_initializationCompleted = If( json?.PropertyT("initializationCompleted"), out var __jsonInitializationCompleted) ? (bool?)__jsonInitializationCompleted : InitializationCompleted;} + {_latency = If( json?.PropertyT("latency"), out var __jsonLatency) ? (long?)__jsonLatency : Latency;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._incomingChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._incomingChange) : null, "incomingChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._appliedChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._appliedChange) : null, "appliedChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcInsertCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcInsertCounter) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcDeleteCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcDeleteCounter) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcUpdateCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcUpdateCounter) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadCompletedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadCompletedTable) : null, "fullLoadCompletedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadLoadingTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadLoadingTable) : null, "fullLoadLoadingTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadQueuedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadQueuedTable) : null, "fullLoadQueuedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadErroredTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadErroredTable) : null, "fullLoadErroredTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._initializationCompleted ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._initializationCompleted) : null, "initializationCompleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._latency ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._latency) : null, "latency" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..3e331885f8ff --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.PowerShell.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..1c1b07860216 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.cs new file mode 100644 index 000000000000..8e24b4ecd2c4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] _event; + + /// List of error events + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get => this._event; set => this._event = value; } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// List of error events + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of error events", + SerializedName = @"events", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// List of error events + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.json.cs new file mode 100644 index 000000000000..b956404ce54b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + {_event = If( json?.PropertyT("events"), out var __jsonEvents) ? If( __jsonEvents as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEvent.FromJson(__u) )) ))() : null : Event;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + if (null != this._event) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._event ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("events",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..3c26383592bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("SourceServerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource?) content.GetValueForProperty("SourceServerType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource.CreateFrom); + } + if (content.Contains("TargetServerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget?) content.GetValueForProperty("TargetServerType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState.CreateFrom); + } + if (content.Contains("DatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).DatabaseCount = (float?) content.GetValueForProperty("DatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).DatabaseCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("SourceServerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource?) content.GetValueForProperty("SourceServerType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).SourceServerType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource.CreateFrom); + } + if (content.Contains("TargetServerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget?) content.GetValueForProperty("TargetServerType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).TargetServerType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState.CreateFrom); + } + if (content.Contains("DatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).DatabaseCount = (float?) content.GetValueForProperty("DatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal)this).DatabaseCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..cc333f13a26d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..d56d53974d92 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.cs @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private float? _databaseCount; + + /// Number of databases to include + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public float? DatabaseCount { get => this._databaseCount; set => this._databaseCount = value; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for SourceServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.SourceServer { get => this._sourceServer; set { {_sourceServer = value;} } } + + /// Internal Acessors for SourceServerType + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.SourceServerType { get => this._sourceServerType; set { {_sourceServerType = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for TargetServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.TargetServer { get => this._targetServer; set { {_targetServer = value;} } } + + /// Internal Acessors for TargetServerType + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.TargetServerType { get => this._targetServerType; set { {_targetServerType = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServer; + + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServer { get => this._sourceServer; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource? _sourceServerType; + + /// Source server type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource? SourceServerType { get => this._sourceServerType; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState? _state; + + /// Migration status + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState? State { get => this._state; } + + /// Backing field for property. + private string _targetServer; + + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServer { get => this._targetServer; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget? _targetServerType; + + /// Target server type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget? TargetServerType { get => this._targetServerType; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + { + /// Number of databases to include + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of databases to include", + SerializedName = @"databaseCount", + PossibleTypes = new [] { typeof(float) })] + float? DatabaseCount { get; set; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server name", + SerializedName = @"sourceServer", + PossibleTypes = new [] { typeof(string) })] + string SourceServer { get; } + /// Source server type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server type.", + SerializedName = @"sourceServerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource? SourceServerType { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Migration status + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState? State { get; } + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server name", + SerializedName = @"targetServer", + PossibleTypes = new [] { typeof(string) })] + string TargetServer { get; } + /// Target server type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server type.", + SerializedName = @"targetServerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget? TargetServerType { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal + { + /// Number of databases to include + float? DatabaseCount { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Source server name + string SourceServer { get; set; } + /// Source server type. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource? SourceServerType { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Migration status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState? State { get; set; } + /// Target server name + string TargetServer { get; set; } + /// Target server type. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget? TargetServerType { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..8a7a6106150e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.json.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(json); + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServer = If( json?.PropertyT("sourceServer"), out var __jsonSourceServer) ? (string)__jsonSourceServer : (string)SourceServer;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServer = If( json?.PropertyT("targetServer"), out var __jsonTargetServer) ? (string)__jsonTargetServer : (string)TargetServer;} + {_sourceServerType = If( json?.PropertyT("sourceServerType"), out var __jsonSourceServerType) ? (string)__jsonSourceServerType : (string)SourceServerType;} + {_targetServerType = If( json?.PropertyT("targetServerType"), out var __jsonTargetServerType) ? (string)__jsonTargetServerType : (string)TargetServerType;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_databaseCount = If( json?.PropertyT("databaseCount"), out var __jsonDatabaseCount) ? (float?)__jsonDatabaseCount : DatabaseCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServer.ToString()) : null, "sourceServer" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServer.ToString()) : null, "targetServer" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerType.ToString()) : null, "sourceServerType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerType.ToString()) : null, "targetServerType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + AddIf( null != this._databaseCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((float)this._databaseCount) : null, "databaseCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.PowerShell.cs new file mode 100644 index 000000000000..af9bf85f0758 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.PowerShell.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.TypeConverter.cs new file mode 100644 index 000000000000..9290d1fd94ed --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.cs new file mode 100644 index 000000000000..c452011183a3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.cs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(); + + /// Backing field for property. + private long? _cdcDeleteCounter; + + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private long? _cdcInsertCounter; + + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private long? _cdcUpdateCounter; + + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private long? _dataErrorsCounter; + + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataErrorsCounter { get => this._dataErrorsCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEndedOn; + + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEndedOn { get => this._fullLoadEndedOn; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEstFinishTime; + + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadStartedOn; + + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadStartedOn { get => this._fullLoadStartedOn; } + + /// Backing field for property. + private long? _fullLoadTotalRow; + + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadTotalRow { get => this._fullLoadTotalRow; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).Id = value; } + + /// Internal Acessors for CdcDeleteCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DataErrorsCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.DataErrorsCounter { get => this._dataErrorsCounter; set { {_dataErrorsCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for FullLoadEndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadEndedOn { get => this._fullLoadEndedOn; set { {_fullLoadEndedOn = value;} } } + + /// Internal Acessors for FullLoadEstFinishTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; set { {_fullLoadEstFinishTime = value;} } } + + /// Internal Acessors for FullLoadStartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadStartedOn { get => this._fullLoadStartedOn; set { {_fullLoadStartedOn = value;} } } + + /// Internal Acessors for FullLoadTotalRow + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.FullLoadTotalRow { get => this._fullLoadTotalRow; set { {_fullLoadTotalRow = value;} } } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for TableName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.TableName { get => this._tableName; set { {_tableName = value;} } } + + /// Internal Acessors for TotalChangesApplied + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal.TotalChangesApplied { get => this._totalChangesApplied; set { {_totalChangesApplied = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal)__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? _state; + + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get => this._state; } + + /// Backing field for property. + private string _tableName; + + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TableName { get => this._tableName; } + + /// Backing field for property. + private long? _totalChangesApplied; + + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? TotalChangesApplied { get => this._totalChangesApplied; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput), __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput); + } + } + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + { + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcDeleteCounter { get; } + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcInsertCounter { get; } + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcUpdateCounter { get; } + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of data errors occurred", + SerializedName = @"dataErrorsCounter", + PossibleTypes = new [] { typeof(long) })] + long? DataErrorsCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load end time", + SerializedName = @"fullLoadEndedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEndedOn { get; } + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Estimate to finish full load", + SerializedName = @"fullLoadEstFinishTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEstFinishTime { get; } + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load start time", + SerializedName = @"fullLoadStartedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadStartedOn { get; } + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of rows applied in full load", + SerializedName = @"fullLoadTotalRows", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadTotalRow { get; } + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last modified time on target", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of the table migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; } + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the table", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string TableName { get; } + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of applied changes", + SerializedName = @"totalChangesApplied", + PossibleTypes = new [] { typeof(long) })] + long? TotalChangesApplied { get; } + + } + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputInternal + { + /// Number of applied deletes + long? CdcDeleteCounter { get; set; } + /// Number of applied inserts + long? CdcInsertCounter { get; set; } + /// Number of applied updates + long? CdcUpdateCounter { get; set; } + /// Number of data errors occurred + long? DataErrorsCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Full load end time + global::System.DateTime? FullLoadEndedOn { get; set; } + /// Estimate to finish full load + global::System.DateTime? FullLoadEstFinishTime { get; set; } + /// Full load start time + global::System.DateTime? FullLoadStartedOn { get; set; } + /// Number of rows applied in full load + long? FullLoadTotalRow { get; set; } + /// Last modified time on target + global::System.DateTime? LastModifiedTime { get; set; } + /// Current state of the table migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; set; } + /// Name of the table + string TableName { get; set; } + /// Total number of applied changes + long? TotalChangesApplied { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.json.cs new file mode 100644 index 000000000000..148f1ce108e6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.json.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(json); + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (long?)__jsonCdcInsertCounter : CdcInsertCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (long?)__jsonCdcUpdateCounter : CdcUpdateCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (long?)__jsonCdcDeleteCounter : CdcDeleteCounter;} + {_fullLoadEstFinishTime = If( json?.PropertyT("fullLoadEstFinishTime"), out var __jsonFullLoadEstFinishTime) ? global::System.DateTime.TryParse((string)__jsonFullLoadEstFinishTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEstFinishTimeValue) ? __jsonFullLoadEstFinishTimeValue : FullLoadEstFinishTime : FullLoadEstFinishTime;} + {_fullLoadStartedOn = If( json?.PropertyT("fullLoadStartedOn"), out var __jsonFullLoadStartedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadStartedOnValue) ? __jsonFullLoadStartedOnValue : FullLoadStartedOn : FullLoadStartedOn;} + {_fullLoadEndedOn = If( json?.PropertyT("fullLoadEndedOn"), out var __jsonFullLoadEndedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEndedOnValue) ? __jsonFullLoadEndedOnValue : FullLoadEndedOn : FullLoadEndedOn;} + {_fullLoadTotalRow = If( json?.PropertyT("fullLoadTotalRows"), out var __jsonFullLoadTotalRows) ? (long?)__jsonFullLoadTotalRows : FullLoadTotalRow;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_totalChangesApplied = If( json?.PropertyT("totalChangesApplied"), out var __jsonTotalChangesApplied) ? (long?)__jsonTotalChangesApplied : TotalChangesApplied;} + {_dataErrorsCounter = If( json?.PropertyT("dataErrorsCounter"), out var __jsonDataErrorsCounter) ? (long?)__jsonDataErrorsCounter : DataErrorsCounter;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tableName.ToString()) : null, "tableName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcInsertCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcInsertCounter) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcUpdateCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcUpdateCounter) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcDeleteCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcDeleteCounter) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEstFinishTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEstFinishTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEstFinishTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadStartedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadStartedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadStartedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEndedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEndedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEndedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadTotalRow ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadTotalRow) : null, "fullLoadTotalRows" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalChangesApplied ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._totalChangesApplied) : null, "totalChangesApplied" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataErrorsCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataErrorsCounter) : null, "dataErrorsCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..7d317949929e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..7954f6b3568b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 000000000000..04ae718a8a37 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Backing field for property. + private string _createdOn; + + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CreatedOn { get => this._createdOn; set => this._createdOn = value; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput()); set => this._input = value; } + + /// Backing field for property. + private bool? _isCloneable; + + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsCloneable { get => this._isCloneable; set => this._isCloneable = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Backing field for property. + private string _taskId; + + /// task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + public partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DateTime in UTC when the task was created", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(string) })] + string CreatedOn { get; set; } + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput Input { get; set; } + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether the task can be cloned or not", + SerializedName = @"isCloneable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[] Output { get; } + /// task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"task id", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + internal partial interface IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// DateTime in UTC when the task was created + string CreatedOn { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput Input { get; set; } + /// whether the task can be cloned or not + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[] Output { get; set; } + /// task id + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..50a5a0b3b33f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations + /// + public partial class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? (string)__jsonCreatedOn : (string)CreatedOn;} + {_isCloneable = If( json?.PropertyT("isCloneable"), out var __jsonIsCloneable) ? (bool?)__jsonIsCloneable : IsCloneable;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != (((object)this._createdOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdOn.ToString()) : null, "createdOn" ,container.Add ); + AddIf( null != this._isCloneable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isCloneable) : null, "isCloneable" ,container.Add ); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..5e2050ccfd35 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.PowerShell.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database input for migrate schema Sql Server to Azure SQL Server scenario + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbDatabaseInputTypeConverter))] + public partial class MigrateSchemaSqlServerSqlDbDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlServerSqlDbDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlServerSqlDbDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlServerSqlDbDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting) content.GetValueForProperty("SchemaSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SchemaSettingSchemaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingSchemaOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption?) content.GetValueForProperty("SchemaSettingSchemaOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingSchemaOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption.CreateFrom); + } + if (content.Contains("SchemaSettingFileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileId = (string) content.GetValueForProperty("SchemaSettingFileId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileId, global::System.Convert.ToString); + } + if (content.Contains("SchemaSettingFileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileName = (string) content.GetValueForProperty("SchemaSettingFileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlServerSqlDbDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting) content.GetValueForProperty("SchemaSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SchemaSettingSchemaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingSchemaOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption?) content.GetValueForProperty("SchemaSettingSchemaOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingSchemaOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption.CreateFrom); + } + if (content.Contains("SchemaSettingFileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileId = (string) content.GetValueForProperty("SchemaSettingFileId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileId, global::System.Convert.ToString); + } + if (content.Contains("SchemaSettingFileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileName = (string) content.GetValueForProperty("SchemaSettingFileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal)this).SchemaSettingFileName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database input for migrate schema Sql Server to Azure SQL Server scenario + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbDatabaseInputTypeConverter))] + public partial interface IMigrateSchemaSqlServerSqlDbDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..974f4d14d8c9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlServerSqlDbDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlServerSqlDbDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.cs new file mode 100644 index 000000000000..8c57c6fd4ca7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database input for migrate schema Sql Server to Azure SQL Server scenario + public partial class MigrateSchemaSqlServerSqlDbDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal + { + + /// Backing field for property. + private string _id; + + /// Id of the source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for SchemaSetting + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInputInternal.SchemaSetting { get => (this._schemaSetting = this._schemaSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaMigrationSetting()); set { {_schemaSetting = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting _schemaSetting; + + /// Database schema migration settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting SchemaSetting { get => (this._schemaSetting = this._schemaSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaMigrationSetting()); set => this._schemaSetting = value; } + + /// Resource Identifier of a file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SchemaSettingFileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)SchemaSetting).FileId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)SchemaSetting).FileId = value ?? null; } + + /// Name of the file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SchemaSettingFileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)SchemaSetting).FileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)SchemaSetting).FileName = value ?? null; } + + /// Option on how to migrate the schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption? SchemaSettingSchemaOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)SchemaSetting).SchemaOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)SchemaSetting).SchemaOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption)""); } + + /// Backing field for property. + private string _targetDatabaseName; + + /// Name of target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// + /// Creates an new instance. + /// + public MigrateSchemaSqlServerSqlDbDatabaseInput() + { + + } + } + /// Database input for migrate schema Sql Server to Azure SQL Server scenario + public partial interface IMigrateSchemaSqlServerSqlDbDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Id of the source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the source database", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Name of source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of source database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Resource Identifier of a file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Identifier of a file resource containing the uploaded schema file", + SerializedName = @"fileId", + PossibleTypes = new [] { typeof(string) })] + string SchemaSettingFileId { get; set; } + /// Name of the file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the file resource containing the uploaded schema file", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + string SchemaSettingFileName { get; set; } + /// Option on how to migrate the schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Option on how to migrate the schema", + SerializedName = @"schemaOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption? SchemaSettingSchemaOption { get; set; } + /// Name of target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of target database", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + + } + /// Database input for migrate schema Sql Server to Azure SQL Server scenario + internal partial interface IMigrateSchemaSqlServerSqlDbDatabaseInputInternal + + { + /// Id of the source database + string Id { get; set; } + /// Name of source database + string Name { get; set; } + /// Database schema migration settings + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting SchemaSetting { get; set; } + /// Resource Identifier of a file resource containing the uploaded schema file + string SchemaSettingFileId { get; set; } + /// Name of the file resource containing the uploaded schema file + string SchemaSettingFileName { get; set; } + /// Option on how to migrate the schema + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption? SchemaSettingSchemaOption { get; set; } + /// Name of target database + string TargetDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.json.cs new file mode 100644 index 000000000000..4a88ef331aaf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbDatabaseInput.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database input for migrate schema Sql Server to Azure SQL Server scenario + public partial class MigrateSchemaSqlServerSqlDbDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSchemaSqlServerSqlDbDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlServerSqlDbDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_schemaSetting = If( json?.PropertyT("schemaSetting"), out var __jsonSchemaSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaMigrationSetting.FromJson(__jsonSchemaSetting) : SchemaSetting;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._schemaSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._schemaSetting.ToJson(null,serializationMode) : null, "schemaSetting" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.PowerShell.cs new file mode 100644 index 000000000000..cffb4e50c084 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.PowerShell.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for task that migrates Schema for SQL Server databases to Azure SQL databases + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskInputTypeConverter))] + public partial class MigrateSchemaSqlServerSqlDbTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlServerSqlDbTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlServerSqlDbTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).StartedOn = (string) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).StartedOn, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).StartedOn = (string) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal)this).StartedOn, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for task that migrates Schema for SQL Server databases to Azure SQL databases + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskInputTypeConverter))] + public partial interface IMigrateSchemaSqlServerSqlDbTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..78b6c14a5988 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlServerSqlDbTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlServerSqlDbTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.cs new file mode 100644 index 000000000000..cdd4ea7b47b2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates Schema for SQL Server databases to Azure SQL databases + /// + public partial class MigrateSchemaSqlServerSqlDbTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(); + + /// Backing field for property. + private string _encryptedKeyForSecureField; + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EncryptedKeyForSecureField { get => this._encryptedKeyForSecureField; set => this._encryptedKeyForSecureField = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName = value ?? null; } + + /// Backing field for property. + private string _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StartedOn { get => this._startedOn; set => this._startedOn = value; } + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName = value ?? null; } + + /// Creates an new instance. + public MigrateSchemaSqlServerSqlDbTaskInput() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + await eventListener.AssertObjectIsValid(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + } + } + /// Input for task that migrates Schema for SQL Server databases to Azure SQL databases + public partial interface IMigrateSchemaSqlServerSqlDbTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput + { + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string EncryptedKeyForSecureField { get; set; } + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput[] SelectedDatabase { get; set; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(string) })] + string StartedOn { get; set; } + + } + /// Input for task that migrates Schema for SQL Server databases to Azure SQL databases + internal partial interface IMigrateSchemaSqlServerSqlDbTaskInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal + { + /// encrypted key for secure fields + string EncryptedKeyForSecureField { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput[] SelectedDatabase { get; set; } + /// Migration start time + string StartedOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.json.cs new file mode 100644 index 000000000000..3d9f10b9e303 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskInput.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates Schema for SQL Server databases to Azure SQL databases + /// + public partial class MigrateSchemaSqlServerSqlDbTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSchemaSqlServerSqlDbTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlServerSqlDbTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(json); + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + {_encryptedKeyForSecureField = If( json?.PropertyT("encryptedKeyForSecureFields"), out var __jsonEncryptedKeyForSecureFields) ? (string)__jsonEncryptedKeyForSecureFields : (string)EncryptedKeyForSecureField;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? (string)__jsonStartedOn : (string)StartedOn;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __sqlMigrationTaskInput?.ToJson(container, serializationMode); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AddIf( null != (((object)this._encryptedKeyForSecureField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._encryptedKeyForSecureField.ToString()) : null, "encryptedKeyForSecureFields" ,container.Add ); + AddIf( null != (((object)this._startedOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn.ToString()) : null, "startedOn" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..fd258952b925 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that migrates Schema for SQL Server databases to Azure SQL databases + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputTypeConverter))] + public partial class MigrateSchemaSqlServerSqlDbTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that migrates Schema for SQL Server databases to Azure SQL databases + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputTypeConverter))] + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..641d6f09d2db --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlServerSqlDbTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlServerSqlDbTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.cs new file mode 100644 index 000000000000..f8374788c426 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates Schema for SQL Server databases to Azure SQL databases + /// + public partial class MigrateSchemaSqlServerSqlDbTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Creates an new instance. + public MigrateSchemaSqlServerSqlDbTaskOutput() + { + + } + } + /// Output for the task that migrates Schema for SQL Server databases to Azure SQL databases + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that migrates Schema for SQL Server databases to Azure SQL databases + internal partial interface IMigrateSchemaSqlServerSqlDbTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.json.cs new file mode 100644 index 000000000000..39595ce75382 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutput.json.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates Schema for SQL Server databases to Azure SQL databases + /// + public partial class MigrateSchemaSqlServerSqlDbTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(json); + } + case "SchemaErrorOutput": + { + return new MigrateSchemaSqlServerSqlDbTaskOutputError(json); + } + case "ErrorOutput": + { + return new MigrateSchemaSqlTaskOutputError(json); + } + } + return new MigrateSchemaSqlServerSqlDbTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlServerSqlDbTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..f0a246950e2d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatabaseErrorResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseErrorResultPrefix = (string) content.GetValueForProperty("DatabaseErrorResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseErrorResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("SchemaErrorResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).SchemaErrorResultPrefix = (string) content.GetValueForProperty("SchemaErrorResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).SchemaErrorResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("NumberOfSuccessfulOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfSuccessfulOperation = (long?) content.GetValueForProperty("NumberOfSuccessfulOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfSuccessfulOperation, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NumberOfFailedOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfFailedOperation = (long?) content.GetValueForProperty("NumberOfFailedOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfFailedOperation, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).FileId = (string) content.GetValueForProperty("FileId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).FileId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatabaseErrorResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseErrorResultPrefix = (string) content.GetValueForProperty("DatabaseErrorResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseErrorResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("SchemaErrorResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).SchemaErrorResultPrefix = (string) content.GetValueForProperty("SchemaErrorResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).SchemaErrorResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("NumberOfSuccessfulOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfSuccessfulOperation = (long?) content.GetValueForProperty("NumberOfSuccessfulOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfSuccessfulOperation, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NumberOfFailedOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfFailedOperation = (long?) content.GetValueForProperty("NumberOfFailedOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfFailedOperation, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).FileId = (string) content.GetValueForProperty("FileId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).FileId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..2adb0c89e3f7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..31424fe9d7b3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(); + + /// Backing field for property. + private string _databaseErrorResultPrefix; + + /// Prefix string to use for querying errors for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseErrorResultPrefix { get => this._databaseErrorResultPrefix; } + + /// Backing field for property. + private string _databaseName; + + /// The name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private string _fileId; + + /// Identifier for the file resource containing the schema of this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FileId { get => this._fileId; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; } + + /// Internal Acessors for DatabaseErrorResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.DatabaseErrorResultPrefix { get => this._databaseErrorResultPrefix; set { {_databaseErrorResultPrefix = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for FileId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.FileId { get => this._fileId; set { {_fileId = value;} } } + + /// Internal Acessors for NumberOfFailedOperation + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.NumberOfFailedOperation { get => this._numberOfFailedOperation; set { {_numberOfFailedOperation = value;} } } + + /// Internal Acessors for NumberOfSuccessfulOperation + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.NumberOfSuccessfulOperation { get => this._numberOfSuccessfulOperation; set { {_numberOfSuccessfulOperation = value;} } } + + /// Internal Acessors for SchemaErrorResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.SchemaErrorResultPrefix { get => this._schemaErrorResultPrefix; set { {_schemaErrorResultPrefix = value;} } } + + /// Internal Acessors for Stage + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.Stage { get => this._stage; set { {_stage = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id = value; } + + /// Backing field for property. + private long? _numberOfFailedOperation; + + /// Number of failed operations for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? NumberOfFailedOperation { get => this._numberOfFailedOperation; } + + /// Backing field for property. + private long? _numberOfSuccessfulOperation; + + /// Number of successful operations for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? NumberOfSuccessfulOperation { get => this._numberOfSuccessfulOperation; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _schemaErrorResultPrefix; + + /// Prefix string to use for querying schema errors for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SchemaErrorResultPrefix { get => this._schemaErrorResultPrefix; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage? _stage; + + /// Schema migration stage for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage? Stage { get => this._stage; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// State of the schema migration for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// + /// Creates an new instance. + /// + public MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput + { + /// Prefix string to use for querying errors for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Prefix string to use for querying errors for this database", + SerializedName = @"databaseErrorResultPrefix", + PossibleTypes = new [] { typeof(string) })] + string DatabaseErrorResultPrefix { get; } + /// The name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Identifier for the file resource containing the schema of this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for the file resource containing the schema of this database", + SerializedName = @"fileId", + PossibleTypes = new [] { typeof(string) })] + string FileId { get; } + /// Number of failed operations for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of failed operations for this database", + SerializedName = @"numberOfFailedOperations", + PossibleTypes = new [] { typeof(long) })] + long? NumberOfFailedOperation { get; } + /// Number of successful operations for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of successful operations for this database", + SerializedName = @"numberOfSuccessfulOperations", + PossibleTypes = new [] { typeof(long) })] + long? NumberOfSuccessfulOperation { get; } + /// Prefix string to use for querying schema errors for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Prefix string to use for querying schema errors for this database", + SerializedName = @"schemaErrorResultPrefix", + PossibleTypes = new [] { typeof(string) })] + string SchemaErrorResultPrefix { get; } + /// Schema migration stage for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Schema migration stage for this database", + SerializedName = @"stage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage? Stage { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// State of the schema migration for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"State of the schema migration for this database", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + + } + internal partial interface IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal + { + /// Prefix string to use for querying errors for this database + string DatabaseErrorResultPrefix { get; set; } + /// The name of the database + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Identifier for the file resource containing the schema of this database + string FileId { get; set; } + /// Number of failed operations for this database + long? NumberOfFailedOperation { get; set; } + /// Number of successful operations for this database + long? NumberOfSuccessfulOperation { get; set; } + /// Prefix string to use for querying schema errors for this database + string SchemaErrorResultPrefix { get; set; } + /// Schema migration stage for this database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage? Stage { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// State of the schema migration for this database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..bd40ad061e6c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)Stage;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_databaseErrorResultPrefix = If( json?.PropertyT("databaseErrorResultPrefix"), out var __jsonDatabaseErrorResultPrefix) ? (string)__jsonDatabaseErrorResultPrefix : (string)DatabaseErrorResultPrefix;} + {_schemaErrorResultPrefix = If( json?.PropertyT("schemaErrorResultPrefix"), out var __jsonSchemaErrorResultPrefix) ? (string)__jsonSchemaErrorResultPrefix : (string)SchemaErrorResultPrefix;} + {_numberOfSuccessfulOperation = If( json?.PropertyT("numberOfSuccessfulOperations"), out var __jsonNumberOfSuccessfulOperations) ? (long?)__jsonNumberOfSuccessfulOperations : NumberOfSuccessfulOperation;} + {_numberOfFailedOperation = If( json?.PropertyT("numberOfFailedOperations"), out var __jsonNumberOfFailedOperations) ? (long?)__jsonNumberOfFailedOperations : NumberOfFailedOperation;} + {_fileId = If( json?.PropertyT("fileId"), out var __jsonFileId) ? (string)__jsonFileId : (string)FileId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSchemaSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._stage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stage.ToString()) : null, "stage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseErrorResultPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseErrorResultPrefix.ToString()) : null, "databaseErrorResultPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._schemaErrorResultPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._schemaErrorResultPrefix.ToString()) : null, "schemaErrorResultPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfSuccessfulOperation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._numberOfSuccessfulOperation) : null, "numberOfSuccessfulOperations" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfFailedOperation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._numberOfFailedOperation) : null, "numberOfFailedOperations" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._fileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileId.ToString()) : null, "fileId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..b595fcd5d95d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputErrorTypeConverter))] + public partial class MigrateSchemaSqlServerSqlDbTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CommandText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).CommandText = (string) content.GetValueForProperty("CommandText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).CommandText, global::System.Convert.ToString); + } + if (content.Contains("ErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).ErrorText = (string) content.GetValueForProperty("ErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).ErrorText, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CommandText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).CommandText = (string) content.GetValueForProperty("CommandText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).CommandText, global::System.Convert.ToString); + } + if (content.Contains("ErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).ErrorText = (string) content.GetValueForProperty("ErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal)this).ErrorText, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputErrorTypeConverter))] + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..a3f6edb0e486 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlServerSqlDbTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlServerSqlDbTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.cs new file mode 100644 index 000000000000..3d524a826f0b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlServerSqlDbTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(); + + /// Backing field for property. + private string _commandText; + + /// Schema command which failed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CommandText { get => this._commandText; } + + /// Backing field for property. + private string _errorText; + + /// Reason of failure + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorText { get => this._errorText; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; } + + /// Internal Acessors for CommandText + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal.CommandText { get => this._commandText; set { {_commandText = value;} } } + + /// Internal Acessors for ErrorText + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal.ErrorText { get => this._errorText; set { {_errorText = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateSchemaSqlServerSqlDbTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput + { + /// Schema command which failed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Schema command which failed", + SerializedName = @"commandText", + PossibleTypes = new [] { typeof(string) })] + string CommandText { get; } + /// Reason of failure + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reason of failure", + SerializedName = @"errorText", + PossibleTypes = new [] { typeof(string) })] + string ErrorText { get; } + + } + internal partial interface IMigrateSchemaSqlServerSqlDbTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal + { + /// Schema command which failed + string CommandText { get; set; } + /// Reason of failure + string ErrorText { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.json.cs new file mode 100644 index 000000000000..299e592444b7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputError.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlServerSqlDbTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSchemaSqlServerSqlDbTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlServerSqlDbTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(json); + {_commandText = If( json?.PropertyT("commandText"), out var __jsonCommandText) ? (string)__jsonCommandText : (string)CommandText;} + {_errorText = If( json?.PropertyT("errorText"), out var __jsonErrorText) ? (string)__jsonErrorText : (string)ErrorText;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSchemaSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._commandText)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._commandText.ToString()) : null, "commandText" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorText)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorText.ToString()) : null, "errorText" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..77696630706b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..27d6bc48a04c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..2f06489e54a5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Overall state of the schema migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Overall state of the schema migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Overall state of the schema migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Overall state of the schema migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..d40691fca31e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.json.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(json); + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSchemaSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..212818685e8c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.PowerShell.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for task that migrates Schema for SQL Server databases to Azure SQL databases + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskPropertiesTypeConverter))] + public partial class MigrateSchemaSqlServerSqlDbTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlServerSqlDbTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlServerSqlDbTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlServerSqlDbTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for task that migrates Schema for SQL Server databases to Azure SQL databases + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlServerSqlDbTaskPropertiesTypeConverter))] + public partial interface IMigrateSchemaSqlServerSqlDbTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..b32bf3449564 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlServerSqlDbTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlServerSqlDbTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlServerSqlDbTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.cs new file mode 100644 index 000000000000..d12008a69939 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates Schema for SQL Server databases to Azure SQL databases + /// + public partial class MigrateSchemaSqlServerSqlDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Backing field for property. + private string _createdOn; + + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CreatedOn { get => this._createdOn; set => this._createdOn = value; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskInput()); set => this._input = value; } + + /// Backing field for property. + private bool? _isCloneable; + + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsCloneable { get => this._isCloneable; set => this._isCloneable = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Backing field for property. + private string _taskId; + + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateSchemaSqlServerSqlDbTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for task that migrates Schema for SQL Server databases to Azure SQL databases + public partial interface IMigrateSchemaSqlServerSqlDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DateTime in UTC when the task was created", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(string) })] + string CreatedOn { get; set; } + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput Input { get; set; } + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether the task can be cloned or not", + SerializedName = @"isCloneable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput[] Output { get; } + /// Task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task id ", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Properties for task that migrates Schema for SQL Server databases to Azure SQL databases + internal partial interface IMigrateSchemaSqlServerSqlDbTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// DateTime in UTC when the task was created + string CreatedOn { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskInput Input { get; set; } + /// whether the task can be cloned or not + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput[] Output { get; set; } + /// Task id + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.json.cs new file mode 100644 index 000000000000..71672c499bbe --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlServerSqlDbTaskProperties.json.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates Schema for SQL Server databases to Azure SQL databases + /// + public partial class MigrateSchemaSqlServerSqlDbTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSchemaSqlServerSqlDbTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlServerSqlDbTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? (string)__jsonCreatedOn : (string)CreatedOn;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_isCloneable = If( json?.PropertyT("isCloneable"), out var __jsonIsCloneable) ? (bool?)__jsonIsCloneable : IsCloneable;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._createdOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdOn.ToString()) : null, "createdOn" ,container.Add ); + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != this._isCloneable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isCloneable) : null, "isCloneable" ,container.Add ); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..d00aab26bd99 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlTaskOutputErrorTypeConverter))] + public partial class MigrateSchemaSqlTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSchemaSqlTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSchemaSqlTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSchemaSqlTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSchemaSqlTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSchemaSqlTaskOutputErrorTypeConverter))] + public partial interface IMigrateSchemaSqlTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..b12e6dc84346 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSchemaSqlTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSchemaSqlTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSchemaSqlTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSchemaSqlTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.cs new file mode 100644 index 000000000000..30da127763e8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).Id = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal)__migrateSchemaSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// Creates an new instance. + public MigrateSchemaSqlTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSchemaSqlServerSqlDbTaskOutput), __migrateSchemaSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSchemaSqlTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateSchemaSqlTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlServerSqlDbTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.json.cs new file mode 100644 index 000000000000..9c0d60ad5ef8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSchemaSqlTaskOutputError.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSchemaSqlTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSchemaSqlTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSchemaSqlTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSchemaSqlTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSchemaSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSchemaSqlServerSqlDbTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSchemaSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..85170d9f8837 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database specific information for SQL to SQL migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerDatabaseInputTypeConverter))] + public partial class MigrateSqlServerDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RestoreDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).RestoreDatabaseName = (string) content.GetValueForProperty("RestoreDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).RestoreDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupAndRestoreFolder")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).BackupAndRestoreFolder = (string) content.GetValueForProperty("BackupAndRestoreFolder",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).BackupAndRestoreFolder, global::System.Convert.ToString); + } + if (content.Contains("DatabaseFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).DatabaseFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput[]) content.GetValueForProperty("DatabaseFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).DatabaseFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInputTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RestoreDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).RestoreDatabaseName = (string) content.GetValueForProperty("RestoreDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).RestoreDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupAndRestoreFolder")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).BackupAndRestoreFolder = (string) content.GetValueForProperty("BackupAndRestoreFolder",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).BackupAndRestoreFolder, global::System.Convert.ToString); + } + if (content.Contains("DatabaseFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).DatabaseFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput[]) content.GetValueForProperty("DatabaseFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal)this).DatabaseFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInputTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for SQL to SQL migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerDatabaseInputTypeConverter))] + public partial interface IMigrateSqlServerDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..b3915021f36d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.cs new file mode 100644 index 000000000000..bdeff3fe8c07 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database specific information for SQL to SQL migration task inputs + public partial class MigrateSqlServerDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInputInternal + { + + /// Backing field for property. + private string _backupAndRestoreFolder; + + /// The backup and restore folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string BackupAndRestoreFolder { get => this._backupAndRestoreFolder; set => this._backupAndRestoreFolder = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput[] _databaseFile; + + /// The list of database files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput[] DatabaseFile { get => this._databaseFile; set => this._databaseFile = value; } + + /// Backing field for property. + private string _name; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _restoreDatabaseName; + + /// Name of the database at destination + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string RestoreDatabaseName { get => this._restoreDatabaseName; set => this._restoreDatabaseName = value; } + + /// Creates an new instance. + public MigrateSqlServerDatabaseInput() + { + + } + } + /// Database specific information for SQL to SQL migration task inputs + public partial interface IMigrateSqlServerDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The backup and restore folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The backup and restore folder", + SerializedName = @"backupAndRestoreFolder", + PossibleTypes = new [] { typeof(string) })] + string BackupAndRestoreFolder { get; set; } + /// The list of database files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of database files", + SerializedName = @"databaseFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput[] DatabaseFile { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Name of the database at destination + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database at destination", + SerializedName = @"restoreDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string RestoreDatabaseName { get; set; } + + } + /// Database specific information for SQL to SQL migration task inputs + internal partial interface IMigrateSqlServerDatabaseInputInternal + + { + /// The backup and restore folder + string BackupAndRestoreFolder { get; set; } + /// The list of database files + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput[] DatabaseFile { get; set; } + /// Name of the database + string Name { get; set; } + /// Name of the database at destination + string RestoreDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.json.cs new file mode 100644 index 000000000000..4cc2cfa51207 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerDatabaseInput.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database specific information for SQL to SQL migration task inputs + public partial class MigrateSqlServerDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_restoreDatabaseName = If( json?.PropertyT("restoreDatabaseName"), out var __jsonRestoreDatabaseName) ? (string)__jsonRestoreDatabaseName : (string)RestoreDatabaseName;} + {_backupAndRestoreFolder = If( json?.PropertyT("backupAndRestoreFolder"), out var __jsonBackupAndRestoreFolder) ? (string)__jsonBackupAndRestoreFolder : (string)BackupAndRestoreFolder;} + {_databaseFile = If( json?.PropertyT("databaseFiles"), out var __jsonDatabaseFiles) ? If( __jsonDatabaseFiles as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseFileInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseFileInput.FromJson(__u) )) ))() : null : DatabaseFile;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._restoreDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._restoreDatabaseName.ToString()) : null, "restoreDatabaseName" ,container.Add ); + AddIf( null != (((object)this._backupAndRestoreFolder)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupAndRestoreFolder.ToString()) : null, "backupAndRestoreFolder" ,container.Add ); + if (null != this._databaseFile) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._databaseFile ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("databaseFiles",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..8a71a10a9c67 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database specific information for SQL to Azure SQL DB migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbDatabaseInputTypeConverter))] + public partial class MigrateSqlServerSqlDbDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MakeSourceDbReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).MakeSourceDbReadOnly = (bool?) content.GetValueForProperty("MakeSourceDbReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).MakeSourceDbReadOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTableMapTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny) content.GetValueForProperty("SchemaSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MakeSourceDbReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).MakeSourceDbReadOnly = (bool?) content.GetValueForProperty("MakeSourceDbReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).MakeSourceDbReadOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTableMapTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny) content.GetValueForProperty("SchemaSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).SchemaSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for SQL to Azure SQL DB migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbDatabaseInputTypeConverter))] + public partial interface IMigrateSqlServerSqlDbDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..f5f3967b844d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.cs new file mode 100644 index 000000000000..c3a67dc09952 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database specific information for SQL to Azure SQL DB migration task inputs + public partial class MigrateSqlServerSqlDbDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputInternal + { + + /// Backing field for property. + private string _id; + + /// id of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private bool? _makeSourceDbReadOnly; + + /// Whether to set database read only before migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? MakeSourceDbReadOnly { get => this._makeSourceDbReadOnly; set => this._makeSourceDbReadOnly = value; } + + /// Backing field for property. + private string _name; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny _schemaSetting; + + /// Settings selected for DB schema migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny SchemaSetting { get => (this._schemaSetting = this._schemaSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Any()); set => this._schemaSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap _tableMap; + + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap TableMap { get => (this._tableMap = this._tableMap ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTableMap()); set => this._tableMap = value; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// Creates an new instance. + public MigrateSqlServerSqlDbDatabaseInput() + { + + } + } + /// Database specific information for SQL to Azure SQL DB migration task inputs + public partial interface IMigrateSqlServerSqlDbDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// id of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"id of the database", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Whether to set database read only before migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to set database read only before migration", + SerializedName = @"makeSourceDbReadOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? MakeSourceDbReadOnly { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Settings selected for DB schema migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Settings selected for DB schema migration.", + SerializedName = @"schemaSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny SchemaSetting { get; set; } + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of source to target tables", + SerializedName = @"tableMap", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of target database. Note: Target database will be truncated before starting migration.", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + + } + /// Database specific information for SQL to Azure SQL DB migration task inputs + internal partial interface IMigrateSqlServerSqlDbDatabaseInputInternal + + { + /// id of the database + string Id { get; set; } + /// Whether to set database read only before migration + bool? MakeSourceDbReadOnly { get; set; } + /// Name of the database + string Name { get; set; } + /// Settings selected for DB schema migration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IAny SchemaSetting { get; set; } + /// Mapping of source to target tables + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap TableMap { get; set; } + /// + /// Name of target database. Note: Target database will be truncated before starting migration. + /// + string TargetDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.json.cs new file mode 100644 index 000000000000..5f59283016d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInput.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database specific information for SQL to Azure SQL DB migration task inputs + public partial class MigrateSqlServerSqlDbDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_makeSourceDbReadOnly = If( json?.PropertyT("makeSourceDbReadOnly"), out var __jsonMakeSourceDbReadOnly) ? (bool?)__jsonMakeSourceDbReadOnly : MakeSourceDbReadOnly;} + {_tableMap = If( json?.PropertyT("tableMap"), out var __jsonTableMap) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTableMap.FromJson(__jsonTableMap) : TableMap;} + {_schemaSetting = If( json?.PropertyT("schemaSetting"), out var __jsonSchemaSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Any.FromJson(__jsonSchemaSetting) : SchemaSetting;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AddIf( null != this._makeSourceDbReadOnly ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._makeSourceDbReadOnly) : null, "makeSourceDbReadOnly" ,container.Add ); + AddIf( null != this._tableMap ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tableMap.ToJson(null,serializationMode) : null, "tableMap" ,container.Add ); + AddIf( null != this._schemaSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._schemaSetting.ToJson(null,serializationMode) : null, "schemaSetting" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.PowerShell.cs new file mode 100644 index 000000000000..493986d0af27 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbDatabaseInputTableMapTypeConverter))] + public partial class MigrateSqlServerSqlDbDatabaseInputTableMap + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbDatabaseInputTableMap(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbDatabaseInputTableMap(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbDatabaseInputTableMap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbDatabaseInputTableMap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbDatabaseInputTableMapTypeConverter))] + public partial interface IMigrateSqlServerSqlDbDatabaseInputTableMap + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.TypeConverter.cs new file mode 100644 index 000000000000..a9c7c5c81fea --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbDatabaseInputTableMapTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbDatabaseInputTableMap.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbDatabaseInputTableMap.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbDatabaseInputTableMap.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.cs new file mode 100644 index 000000000000..a08cc8436d18 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateSqlServerSqlDbDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMapInternal + { + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbDatabaseInputTableMap() + { + + } + } + /// Mapping of source to target tables + public partial interface IMigrateSqlServerSqlDbDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Mapping of source to target tables + internal partial interface IMigrateSqlServerSqlDbDatabaseInputTableMapInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.dictionary.cs new file mode 100644 index 000000000000..464ba29bfb55 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTableMap source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.json.cs new file mode 100644 index 000000000000..4374657a4bab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbDatabaseInputTableMap.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateSqlServerSqlDbDatabaseInputTableMap + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInputTableMap FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbDatabaseInputTableMap(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateSqlServerSqlDbDatabaseInputTableMap(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..374dd5cfb35a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.PowerShell.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Database specific information for SQL to Azure SQL DB sync migration task inputs + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTableMapTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SchemaName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SchemaName = (string) content.GetValueForProperty("SchemaName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SchemaName, global::System.Convert.ToString); + } + if (content.Contains("TableMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TableMap = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap) content.GetValueForProperty("TableMap",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TableMap, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTableMapTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).MigrationSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting) content.GetValueForProperty("MigrationSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).MigrationSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputMigrationSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SourceSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SourceSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting) content.GetValueForProperty("SourceSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).SourceSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputSourceSettingTypeConverter.ConvertFrom); + } + if (content.Contains("TargetSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetSetting = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting) content.GetValueForProperty("TargetSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal)this).TargetSetting, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTargetSettingTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for SQL to Azure SQL DB sync migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..2419b855f15d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.cs new file mode 100644 index 000000000000..819f15f45950 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for SQL to Azure SQL DB sync migration task inputs + /// + public partial class MigrateSqlServerSqlDbSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputInternal + { + + /// Backing field for property. + private string _id; + + /// Unique identifier for database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting _migrationSetting; + + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting MigrationSetting { get => (this._migrationSetting = this._migrationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting()); set => this._migrationSetting = value; } + + /// Backing field for property. + private string _name; + + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _schemaName; + + /// Schema name to be migrated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SchemaName { get => this._schemaName; set => this._schemaName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting _sourceSetting; + + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting SourceSetting { get => (this._sourceSetting = this._sourceSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting()); set => this._sourceSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap _tableMap; + + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap TableMap { get => (this._tableMap = this._tableMap ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTableMap()); set => this._tableMap = value; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// Target database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting _targetSetting; + + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting TargetSetting { get => (this._targetSetting = this._targetSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting()); set => this._targetSetting = value; } + + /// Creates an new instance. + public MigrateSqlServerSqlDbSyncDatabaseInput() + { + + } + } + /// Database specific information for SQL to Azure SQL DB sync migration task inputs + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Unique identifier for database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique identifier for database", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Migration settings which tune the migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration settings which tune the migration behavior", + SerializedName = @"migrationSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Schema name to be migrated + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Schema name to be migrated", + SerializedName = @"schemaName", + PossibleTypes = new [] { typeof(string) })] + string SchemaName { get; set; } + /// Source settings to tune source endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source settings to tune source endpoint migration behavior", + SerializedName = @"sourceSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// Mapping of source to target tables + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of source to target tables", + SerializedName = @"tableMap", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap TableMap { get; set; } + /// Target database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target database name", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target settings to tune target endpoint migration behavior", + SerializedName = @"targetSetting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } + /// Database specific information for SQL to Azure SQL DB sync migration task inputs + internal partial interface IMigrateSqlServerSqlDbSyncDatabaseInputInternal + + { + /// Unique identifier for database + string Id { get; set; } + /// Migration settings which tune the migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting MigrationSetting { get; set; } + /// Name of database + string Name { get; set; } + /// Schema name to be migrated + string SchemaName { get; set; } + /// Source settings to tune source endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting SourceSetting { get; set; } + /// Mapping of source to target tables + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap TableMap { get; set; } + /// Target database name + string TargetDatabaseName { get; set; } + /// Target settings to tune target endpoint migration behavior + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting TargetSetting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.json.cs new file mode 100644 index 000000000000..2c9c0308abe1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInput.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for SQL to Azure SQL DB sync migration task inputs + /// + public partial class MigrateSqlServerSqlDbSyncDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_schemaName = If( json?.PropertyT("schemaName"), out var __jsonSchemaName) ? (string)__jsonSchemaName : (string)SchemaName;} + {_tableMap = If( json?.PropertyT("tableMap"), out var __jsonTableMap) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTableMap.FromJson(__jsonTableMap) : TableMap;} + {_migrationSetting = If( json?.PropertyT("migrationSetting"), out var __jsonMigrationSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.FromJson(__jsonMigrationSetting) : MigrationSetting;} + {_sourceSetting = If( json?.PropertyT("sourceSetting"), out var __jsonSourceSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.FromJson(__jsonSourceSetting) : SourceSetting;} + {_targetSetting = If( json?.PropertyT("targetSetting"), out var __jsonTargetSetting) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.FromJson(__jsonTargetSetting) : TargetSetting;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AddIf( null != (((object)this._schemaName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._schemaName.ToString()) : null, "schemaName" ,container.Add ); + AddIf( null != this._tableMap ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tableMap.ToJson(null,serializationMode) : null, "tableMap" ,container.Add ); + AddIf( null != this._migrationSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationSetting.ToJson(null,serializationMode) : null, "migrationSetting" ,container.Add ); + AddIf( null != this._sourceSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceSetting.ToJson(null,serializationMode) : null, "sourceSetting" ,container.Add ); + AddIf( null != this._targetSetting ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetSetting.ToJson(null,serializationMode) : null, "targetSetting" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.PowerShell.cs new file mode 100644 index 000000000000..5b9e20a1f83c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputMigrationSettingTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration settings which tune the migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputMigrationSettingTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.TypeConverter.cs new file mode 100644 index 000000000000..34f3fa2aeb4b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncDatabaseInputMigrationSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.cs new file mode 100644 index 000000000000..cbdfbe7db88e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting() + { + + } + } + /// Migration settings which tune the migration behavior + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Migration settings which tune the migration behavior + internal partial interface IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.dictionary.cs new file mode 100644 index 000000000000..54aa53da7471 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.json.cs new file mode 100644 index 000000000000..d8b400438c9f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration settings which tune the migration behavior + public partial class MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateSqlServerSqlDbSyncDatabaseInputMigrationSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.PowerShell.cs new file mode 100644 index 000000000000..a1b73d1bbd6a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputSourceSettingTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Source settings to tune source endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputSourceSettingTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.TypeConverter.cs new file mode 100644 index 000000000000..e4b460f9a94e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncDatabaseInputSourceSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.cs new file mode 100644 index 000000000000..25acca3e360a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting() + { + + } + } + /// Source settings to tune source endpoint migration behavior + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Source settings to tune source endpoint migration behavior + internal partial interface IMigrateSqlServerSqlDbSyncDatabaseInputSourceSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.dictionary.cs new file mode 100644 index 000000000000..e259b14cba41 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.json.cs new file mode 100644 index 000000000000..f65285646ef4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source settings to tune source endpoint migration behavior + public partial class MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputSourceSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateSqlServerSqlDbSyncDatabaseInputSourceSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.PowerShell.cs new file mode 100644 index 000000000000..90f89dfe269e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputTableMapTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTableMap + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputTableMap(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputTableMap(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputTableMap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputTableMap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mapping of source to target tables + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputTableMapTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputTableMap + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.TypeConverter.cs new file mode 100644 index 000000000000..d39b684b3c10 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTableMapTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncDatabaseInputTableMap.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputTableMap.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputTableMap.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.cs new file mode 100644 index 000000000000..1e46b44f5094 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMapInternal + { + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncDatabaseInputTableMap() + { + + } + } + /// Mapping of source to target tables + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Mapping of source to target tables + internal partial interface IMigrateSqlServerSqlDbSyncDatabaseInputTableMapInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.dictionary.cs new file mode 100644 index 000000000000..b68e94f1220c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTableMap : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTableMap source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.json.cs new file mode 100644 index 000000000000..b0ba246b552e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTableMap.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Mapping of source to target tables + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTableMap + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTableMap FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncDatabaseInputTableMap(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateSqlServerSqlDbSyncDatabaseInputTableMap(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.PowerShell.cs new file mode 100644 index 000000000000..cbba2babf7b8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputTargetSettingTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Target settings to tune target endpoint migration behavior + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncDatabaseInputTargetSettingTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.TypeConverter.cs new file mode 100644 index 000000000000..e923a4911d67 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTargetSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.cs new file mode 100644 index 000000000000..668e34e4f71f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSettingInternal + { + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting() + { + + } + } + /// Target settings to tune target endpoint migration behavior + public partial interface IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Target settings to tune target endpoint migration behavior + internal partial interface IMigrateSqlServerSqlDbSyncDatabaseInputTargetSettingInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.dictionary.cs new file mode 100644 index 000000000000..a460bd3942b9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.json.cs new file mode 100644 index 000000000000..163bc7b900d4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target settings to tune target endpoint migration behavior + public partial class MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInputTargetSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrateSqlServerSqlDbSyncDatabaseInputTargetSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..283b00ab7688 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.PowerShell.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskInputTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions) content.GetValueForProperty("ValidationOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationOptionEnableSchemaValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableSchemaValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableSchemaValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableSchemaValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableDataIntegrityValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableDataIntegrityValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableQueryAnalysisValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableQueryAnalysisValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions) content.GetValueForProperty("ValidationOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationOptionEnableSchemaValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableSchemaValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableSchemaValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableSchemaValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableDataIntegrityValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableDataIntegrityValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableQueryAnalysisValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableQueryAnalysisValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskInputTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..b473a3f0e4bd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.cs new file mode 100644 index 000000000000..4f6dff445e11 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + public partial class MigrateSqlServerSqlDbSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(); + + /// Internal Acessors for ValidationOption + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInputInternal.ValidationOption { get => (this._validationOption = this._validationOption ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions()); set { {_validationOption = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName = value ?? null; } + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions _validationOption; + + /// Validation options + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions ValidationOption { get => (this._validationOption = this._validationOption ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions()); set => this._validationOption = value; } + + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ValidationOptionEnableDataIntegrityValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableDataIntegrityValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableDataIntegrityValidation = value ?? default(bool); } + + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ValidationOptionEnableQueryAnalysisValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableQueryAnalysisValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableQueryAnalysisValidation = value ?? default(bool); } + + /// Allows to compare the schema information between source and target. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ValidationOptionEnableSchemaValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableSchemaValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableSchemaValidation = value ?? default(bool); } + + /// Creates an new instance. + public MigrateSqlServerSqlDbSyncTaskInput() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + await eventListener.AssertObjectIsValid(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + } + } + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + public partial interface IMigrateSqlServerSqlDbSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput + { + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] SelectedDatabase { get; set; } + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to perform a checksum based data integrity validation between source and target for the selected database / tables .", + SerializedName = @"enableDataIntegrityValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidationOptionEnableDataIntegrityValidation { get; set; } + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries.", + SerializedName = @"enableQueryAnalysisValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidationOptionEnableQueryAnalysisValidation { get; set; } + /// Allows to compare the schema information between source and target. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to compare the schema information between source and target.", + SerializedName = @"enableSchemaValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidationOptionEnableSchemaValidation { get; set; } + + } + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + internal partial interface IMigrateSqlServerSqlDbSyncTaskInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal + { + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Validation options + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions ValidationOption { get; set; } + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + bool? ValidationOptionEnableDataIntegrityValidation { get; set; } + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + bool? ValidationOptionEnableQueryAnalysisValidation { get; set; } + /// Allows to compare the schema information between source and target. + bool? ValidationOptionEnableSchemaValidation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.json.cs new file mode 100644 index 000000000000..809c111f1ca8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskInput.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + public partial class MigrateSqlServerSqlDbSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(json); + {_validationOption = If( json?.PropertyT("validationOptions"), out var __jsonValidationOptions) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions.FromJson(__jsonValidationOptions) : ValidationOption;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __sqlMigrationTaskInput?.ToJson(container, serializationMode); + AddIf( null != this._validationOption ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._validationOption.ToJson(null,serializationMode) : null, "validationOptions" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..a1c06d915f4b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..5dc2a0c1f9f2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.cs new file mode 100644 index 000000000000..bad3e55a7cf5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Creates an new instance. + public MigrateSqlServerSqlDbSyncTaskOutput() + { + + } + } + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + public partial interface IMigrateSqlServerSqlDbSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + internal partial interface IMigrateSqlServerSqlDbSyncTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.json.cs new file mode 100644 index 000000000000..872850fa112c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutput.json.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(json); + } + case "TableLevelOutput": + { + return new MigrateSqlServerSqlDbSyncTaskOutputTableLevel(json); + } + case "ErrorOutput": + { + return new MigrateSqlServerSqlDbSyncTaskOutputError(json); + } + case "DatabaseLevelErrorOutput": + { + return new MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(json); + } + } + return new MigrateSqlServerSqlDbSyncTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.PowerShell.cs new file mode 100644 index 000000000000..6fb494898854 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).Event = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[]) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal)this).Event, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEventTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.TypeConverter.cs new file mode 100644 index 000000000000..64eb2d298bc2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.cs new file mode 100644 index 000000000000..25ca5c82c516 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(); + + /// Backing field for property. + private string _errorMessage; + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] _event; + + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get => this._event; set => this._event = value; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType = value ; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncTaskOutputDatabaseError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput + { + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; set; } + /// List of error events. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of error events.", + SerializedName = @"events", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } + internal partial interface IMigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal + { + /// Error message + string ErrorMessage { get; set; } + /// List of error events. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent[] Event { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.json.cs new file mode 100644 index 000000000000..72c4122db6d9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(json); + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} + {_event = If( json?.PropertyT("events"), out var __jsonEvents) ? If( __jsonEvents as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SyncMigrationDatabaseErrorEvent.FromJson(__u) )) ))() : null : Event;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbSyncTaskOutput?.ToJson(container, serializationMode); + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + if (null != this._event) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._event ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("events",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..60c27cb7d57d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState.CreateFrom); + } + if (content.Contains("IncomingChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).IncomingChange = (long?) content.GetValueForProperty("IncomingChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).IncomingChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AppliedChange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).AppliedChange = (long?) content.GetValueForProperty("AppliedChange",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).AppliedChange, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadCompletedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable = (long?) content.GetValueForProperty("FullLoadCompletedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadCompletedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadLoadingTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable = (long?) content.GetValueForProperty("FullLoadLoadingTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadLoadingTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadQueuedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable = (long?) content.GetValueForProperty("FullLoadQueuedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadQueuedTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadErroredTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable = (long?) content.GetValueForProperty("FullLoadErroredTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).FullLoadErroredTable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("InitializationCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted = (bool?) content.GetValueForProperty("InitializationCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).InitializationCompleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Latency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).Latency = (long?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal)this).Latency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..6b6c166381d3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..757b1e544077 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(); + + /// Backing field for property. + private long? _appliedChange; + + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? AppliedChange { get => this._appliedChange; } + + /// Backing field for property. + private long? _cdcDeleteCounter; + + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private long? _cdcInsertCounter; + + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private long? _cdcUpdateCounter; + + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private long? _fullLoadCompletedTable; + + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadCompletedTable { get => this._fullLoadCompletedTable; } + + /// Backing field for property. + private long? _fullLoadErroredTable; + + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadErroredTable { get => this._fullLoadErroredTable; } + + /// Backing field for property. + private long? _fullLoadLoadingTable; + + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadLoadingTable { get => this._fullLoadLoadingTable; } + + /// Backing field for property. + private long? _fullLoadQueuedTable; + + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadQueuedTable { get => this._fullLoadQueuedTable; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; } + + /// Backing field for property. + private long? _incomingChange; + + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? IncomingChange { get => this._incomingChange; } + + /// Backing field for property. + private bool? _initializationCompleted; + + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? InitializationCompleted { get => this._initializationCompleted; } + + /// Backing field for property. + private long? _latency; + + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Latency { get => this._latency; } + + /// Internal Acessors for AppliedChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.AppliedChange { get => this._appliedChange; set { {_appliedChange = value;} } } + + /// Internal Acessors for CdcDeleteCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for FullLoadCompletedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.FullLoadCompletedTable { get => this._fullLoadCompletedTable; set { {_fullLoadCompletedTable = value;} } } + + /// Internal Acessors for FullLoadErroredTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.FullLoadErroredTable { get => this._fullLoadErroredTable; set { {_fullLoadErroredTable = value;} } } + + /// Internal Acessors for FullLoadLoadingTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.FullLoadLoadingTable { get => this._fullLoadLoadingTable; set { {_fullLoadLoadingTable = value;} } } + + /// Internal Acessors for FullLoadQueuedTable + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.FullLoadQueuedTable { get => this._fullLoadQueuedTable; set { {_fullLoadQueuedTable = value;} } } + + /// Internal Acessors for IncomingChange + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.IncomingChange { get => this._incomingChange; set { {_incomingChange = value;} } } + + /// Internal Acessors for InitializationCompleted + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.InitializationCompleted { get => this._initializationCompleted; set { {_initializationCompleted = value;} } } + + /// Internal Acessors for Latency + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.Latency { get => this._latency; set { {_latency = value;} } } + + /// Internal Acessors for MigrationState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? _migrationState; + + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get => this._migrationState; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput + { + /// Number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied changes", + SerializedName = @"appliedChanges", + PossibleTypes = new [] { typeof(long) })] + long? AppliedChange { get; } + /// Number of cdc deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcDeleteCounter { get; } + /// Number of cdc inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcInsertCounter { get; } + /// Number of cdc updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of cdc updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcUpdateCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Number of tables completed in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables completed in full load", + SerializedName = @"fullLoadCompletedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadCompletedTable { get; } + /// Number of tables errored in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables errored in full load", + SerializedName = @"fullLoadErroredTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadErroredTable { get; } + /// Number of tables loading in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables loading in full load", + SerializedName = @"fullLoadLoadingTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadLoadingTable { get; } + /// Number of tables queued in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of tables queued in full load", + SerializedName = @"fullLoadQueuedTables", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadQueuedTable { get; } + /// Number of incoming changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of incoming changes", + SerializedName = @"incomingChanges", + PossibleTypes = new [] { typeof(long) })] + long? IncomingChange { get; } + /// Indicates if initial load (full load) has been completed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if initial load (full load) has been completed", + SerializedName = @"initializationCompleted", + PossibleTypes = new [] { typeof(bool) })] + bool? InitializationCompleted { get; } + /// CDC apply latency + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"CDC apply latency", + SerializedName = @"latency", + PossibleTypes = new [] { typeof(long) })] + long? Latency { get; } + /// Migration state that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration state that this database is in", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + } + internal partial interface IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal + { + /// Number of applied changes + long? AppliedChange { get; set; } + /// Number of cdc deletes + long? CdcDeleteCounter { get; set; } + /// Number of cdc inserts + long? CdcInsertCounter { get; set; } + /// Number of cdc updates + long? CdcUpdateCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Number of tables completed in full load + long? FullLoadCompletedTable { get; set; } + /// Number of tables errored in full load + long? FullLoadErroredTable { get; set; } + /// Number of tables loading in full load + long? FullLoadLoadingTable { get; set; } + /// Number of tables queued in full load + long? FullLoadQueuedTable { get; set; } + /// Number of incoming changes + long? IncomingChange { get; set; } + /// Indicates if initial load (full load) has been completed + bool? InitializationCompleted { get; set; } + /// CDC apply latency + long? Latency { get; set; } + /// Migration state that this database is in + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState? MigrationState { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..3d0c5d283a37 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + {_incomingChange = If( json?.PropertyT("incomingChanges"), out var __jsonIncomingChanges) ? (long?)__jsonIncomingChanges : IncomingChange;} + {_appliedChange = If( json?.PropertyT("appliedChanges"), out var __jsonAppliedChanges) ? (long?)__jsonAppliedChanges : AppliedChange;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (long?)__jsonCdcInsertCounter : CdcInsertCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (long?)__jsonCdcDeleteCounter : CdcDeleteCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (long?)__jsonCdcUpdateCounter : CdcUpdateCounter;} + {_fullLoadCompletedTable = If( json?.PropertyT("fullLoadCompletedTables"), out var __jsonFullLoadCompletedTables) ? (long?)__jsonFullLoadCompletedTables : FullLoadCompletedTable;} + {_fullLoadLoadingTable = If( json?.PropertyT("fullLoadLoadingTables"), out var __jsonFullLoadLoadingTables) ? (long?)__jsonFullLoadLoadingTables : FullLoadLoadingTable;} + {_fullLoadQueuedTable = If( json?.PropertyT("fullLoadQueuedTables"), out var __jsonFullLoadQueuedTables) ? (long?)__jsonFullLoadQueuedTables : FullLoadQueuedTable;} + {_fullLoadErroredTable = If( json?.PropertyT("fullLoadErroredTables"), out var __jsonFullLoadErroredTables) ? (long?)__jsonFullLoadErroredTables : FullLoadErroredTable;} + {_initializationCompleted = If( json?.PropertyT("initializationCompleted"), out var __jsonInitializationCompleted) ? (bool?)__jsonInitializationCompleted : InitializationCompleted;} + {_latency = If( json?.PropertyT("latency"), out var __jsonLatency) ? (long?)__jsonLatency : Latency;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._incomingChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._incomingChange) : null, "incomingChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._appliedChange ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._appliedChange) : null, "appliedChanges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcInsertCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcInsertCounter) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcDeleteCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcDeleteCounter) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcUpdateCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcUpdateCounter) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadCompletedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadCompletedTable) : null, "fullLoadCompletedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadLoadingTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadLoadingTable) : null, "fullLoadLoadingTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadQueuedTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadQueuedTable) : null, "fullLoadQueuedTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadErroredTable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadErroredTable) : null, "fullLoadErroredTables" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._initializationCompleted ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._initializationCompleted) : null, "initializationCompleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._latency ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._latency) : null, "latency" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..6c5617cb94da --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputErrorTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputErrorTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..d83447ae3d87 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.cs new file mode 100644 index 000000000000..494a54194050 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateSqlServerSqlDbSyncTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.json.cs new file mode 100644 index 000000000000..6a4306f94593 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputError.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..325fcbf8e7af --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("DatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).DatabaseCount = (int?) content.GetValueForProperty("DatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).DatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServer = (string) content.GetValueForProperty("SourceServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).SourceServer, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServer = (string) content.GetValueForProperty("TargetServer",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).TargetServer, global::System.Convert.ToString); + } + if (content.Contains("DatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).DatabaseCount = (int?) content.GetValueForProperty("DatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal)this).DatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..20fbc958733b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..6d51b79b24e8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(); + + /// Backing field for property. + private int? _databaseCount; + + /// Count of databases + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? DatabaseCount { get => this._databaseCount; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id = value; } + + /// Internal Acessors for DatabaseCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal.DatabaseCount { get => this._databaseCount; set { {_databaseCount = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for SourceServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal.SourceServer { get => this._sourceServer; set { {_sourceServer = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for TargetServer + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal.TargetServer { get => this._targetServer; set { {_targetServer = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServer; + + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServer { get => this._sourceServer; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private string _targetServer; + + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServer { get => this._targetServer; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput + { + /// Count of databases + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Count of databases", + SerializedName = @"databaseCount", + PossibleTypes = new [] { typeof(int) })] + int? DatabaseCount { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server name", + SerializedName = @"sourceServer", + PossibleTypes = new [] { typeof(string) })] + string SourceServer { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server name", + SerializedName = @"targetServer", + PossibleTypes = new [] { typeof(string) })] + string TargetServer { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal + { + /// Count of databases + int? DatabaseCount { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Source server name + string SourceServer { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Target server name + string TargetServer { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..eb3cfab691ad --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.json.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(json); + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServer = If( json?.PropertyT("sourceServer"), out var __jsonSourceServer) ? (string)__jsonSourceServer : (string)SourceServer;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServer = If( json?.PropertyT("targetServer"), out var __jsonTargetServer) ? (string)__jsonTargetServer : (string)TargetServer;} + {_databaseCount = If( json?.PropertyT("databaseCount"), out var __jsonDatabaseCount) ? (int?)__jsonDatabaseCount : DatabaseCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServer.ToString()) : null, "sourceServer" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServer.ToString()) : null, "targetServer" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._databaseCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._databaseCount) : null, "databaseCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.PowerShell.cs new file mode 100644 index 000000000000..8b12d0561607 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.PowerShell.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputTableLevelTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskOutputTableLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputTableLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskOutputTableLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputTableLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskOutputTableLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CdcInsertCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcInsertCounter = (long?) content.GetValueForProperty("CdcInsertCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcInsertCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcUpdateCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter = (long?) content.GetValueForProperty("CdcUpdateCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcUpdateCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CdcDeleteCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter = (long?) content.GetValueForProperty("CdcDeleteCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).CdcDeleteCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FullLoadEstFinishTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime = (global::System.DateTime?) content.GetValueForProperty("FullLoadEstFinishTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEstFinishTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadStartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadStartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadStartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadEndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn = (global::System.DateTime?) content.GetValueForProperty("FullLoadEndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadEndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullLoadTotalRow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow = (long?) content.GetValueForProperty("FullLoadTotalRow",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).FullLoadTotalRow, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState.CreateFrom); + } + if (content.Contains("TotalChangesApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TotalChangesApplied = (long?) content.GetValueForProperty("TotalChangesApplied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).TotalChangesApplied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataErrorsCounter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DataErrorsCounter = (long?) content.GetValueForProperty("DataErrorsCounter",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).DataErrorsCounter, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskOutputTableLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputTableLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.TypeConverter.cs new file mode 100644 index 000000000000..187e1edf4065 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskOutputTableLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskOutputTableLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputTableLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskOutputTableLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.cs new file mode 100644 index 000000000000..40a00980f95c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.cs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(); + + /// Backing field for property. + private long? _cdcDeleteCounter; + + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcDeleteCounter { get => this._cdcDeleteCounter; } + + /// Backing field for property. + private long? _cdcInsertCounter; + + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcInsertCounter { get => this._cdcInsertCounter; } + + /// Backing field for property. + private long? _cdcUpdateCounter; + + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? CdcUpdateCounter { get => this._cdcUpdateCounter; } + + /// Backing field for property. + private long? _dataErrorsCounter; + + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataErrorsCounter { get => this._dataErrorsCounter; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEndedOn; + + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEndedOn { get => this._fullLoadEndedOn; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadEstFinishTime; + + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; } + + /// Backing field for property. + private global::System.DateTime? _fullLoadStartedOn; + + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? FullLoadStartedOn { get => this._fullLoadStartedOn; } + + /// Backing field for property. + private long? _fullLoadTotalRow; + + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? FullLoadTotalRow { get => this._fullLoadTotalRow; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).Id = value; } + + /// Internal Acessors for CdcDeleteCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.CdcDeleteCounter { get => this._cdcDeleteCounter; set { {_cdcDeleteCounter = value;} } } + + /// Internal Acessors for CdcInsertCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.CdcInsertCounter { get => this._cdcInsertCounter; set { {_cdcInsertCounter = value;} } } + + /// Internal Acessors for CdcUpdateCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.CdcUpdateCounter { get => this._cdcUpdateCounter; set { {_cdcUpdateCounter = value;} } } + + /// Internal Acessors for DataErrorsCounter + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.DataErrorsCounter { get => this._dataErrorsCounter; set { {_dataErrorsCounter = value;} } } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for FullLoadEndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.FullLoadEndedOn { get => this._fullLoadEndedOn; set { {_fullLoadEndedOn = value;} } } + + /// Internal Acessors for FullLoadEstFinishTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.FullLoadEstFinishTime { get => this._fullLoadEstFinishTime; set { {_fullLoadEstFinishTime = value;} } } + + /// Internal Acessors for FullLoadStartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.FullLoadStartedOn { get => this._fullLoadStartedOn; set { {_fullLoadStartedOn = value;} } } + + /// Internal Acessors for FullLoadTotalRow + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.FullLoadTotalRow { get => this._fullLoadTotalRow; set { {_fullLoadTotalRow = value;} } } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for TableName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.TableName { get => this._tableName; set { {_tableName = value;} } } + + /// Internal Acessors for TotalChangesApplied + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal.TotalChangesApplied { get => this._totalChangesApplied; set { {_totalChangesApplied = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal)__migrateSqlServerSqlDbSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? _state; + + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get => this._state; } + + /// Backing field for property. + private string _tableName; + + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TableName { get => this._tableName; } + + /// Backing field for property. + private long? _totalChangesApplied; + + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? TotalChangesApplied { get => this._totalChangesApplied; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbSyncTaskOutputTableLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbSyncTaskOutput), __migrateSqlServerSqlDbSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbSyncTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput + { + /// Number of applied deletes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied deletes", + SerializedName = @"cdcDeleteCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcDeleteCounter { get; } + /// Number of applied inserts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied inserts", + SerializedName = @"cdcInsertCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcInsertCounter { get; } + /// Number of applied updates + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of applied updates", + SerializedName = @"cdcUpdateCounter", + PossibleTypes = new [] { typeof(long) })] + long? CdcUpdateCounter { get; } + /// Number of data errors occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of data errors occurred", + SerializedName = @"dataErrorsCounter", + PossibleTypes = new [] { typeof(long) })] + long? DataErrorsCounter { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Full load end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load end time", + SerializedName = @"fullLoadEndedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEndedOn { get; } + /// Estimate to finish full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Estimate to finish full load", + SerializedName = @"fullLoadEstFinishTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadEstFinishTime { get; } + /// Full load start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full load start time", + SerializedName = @"fullLoadStartedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullLoadStartedOn { get; } + /// Number of rows applied in full load + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of rows applied in full load", + SerializedName = @"fullLoadTotalRows", + PossibleTypes = new [] { typeof(long) })] + long? FullLoadTotalRow { get; } + /// Last modified time on target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last modified time on target", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// Current state of the table migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of the table migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; } + /// Name of the table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the table", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string TableName { get; } + /// Total number of applied changes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of applied changes", + SerializedName = @"totalChangesApplied", + PossibleTypes = new [] { typeof(long) })] + long? TotalChangesApplied { get; } + + } + internal partial interface IMigrateSqlServerSqlDbSyncTaskOutputTableLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputInternal + { + /// Number of applied deletes + long? CdcDeleteCounter { get; set; } + /// Number of applied inserts + long? CdcInsertCounter { get; set; } + /// Number of applied updates + long? CdcUpdateCounter { get; set; } + /// Number of data errors occurred + long? DataErrorsCounter { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Full load end time + global::System.DateTime? FullLoadEndedOn { get; set; } + /// Estimate to finish full load + global::System.DateTime? FullLoadEstFinishTime { get; set; } + /// Full load start time + global::System.DateTime? FullLoadStartedOn { get; set; } + /// Number of rows applied in full load + long? FullLoadTotalRow { get; set; } + /// Last modified time on target + global::System.DateTime? LastModifiedTime { get; set; } + /// Current state of the table migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState? State { get; set; } + /// Name of the table + string TableName { get; set; } + /// Total number of applied changes + long? TotalChangesApplied { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.json.cs new file mode 100644 index 000000000000..9b45c6a2e540 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.json.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbSyncTaskOutputTableLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncTaskOutputTableLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskOutputTableLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput(json); + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_cdcInsertCounter = If( json?.PropertyT("cdcInsertCounter"), out var __jsonCdcInsertCounter) ? (long?)__jsonCdcInsertCounter : CdcInsertCounter;} + {_cdcUpdateCounter = If( json?.PropertyT("cdcUpdateCounter"), out var __jsonCdcUpdateCounter) ? (long?)__jsonCdcUpdateCounter : CdcUpdateCounter;} + {_cdcDeleteCounter = If( json?.PropertyT("cdcDeleteCounter"), out var __jsonCdcDeleteCounter) ? (long?)__jsonCdcDeleteCounter : CdcDeleteCounter;} + {_fullLoadEstFinishTime = If( json?.PropertyT("fullLoadEstFinishTime"), out var __jsonFullLoadEstFinishTime) ? global::System.DateTime.TryParse((string)__jsonFullLoadEstFinishTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEstFinishTimeValue) ? __jsonFullLoadEstFinishTimeValue : FullLoadEstFinishTime : FullLoadEstFinishTime;} + {_fullLoadStartedOn = If( json?.PropertyT("fullLoadStartedOn"), out var __jsonFullLoadStartedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadStartedOnValue) ? __jsonFullLoadStartedOnValue : FullLoadStartedOn : FullLoadStartedOn;} + {_fullLoadEndedOn = If( json?.PropertyT("fullLoadEndedOn"), out var __jsonFullLoadEndedOn) ? global::System.DateTime.TryParse((string)__jsonFullLoadEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFullLoadEndedOnValue) ? __jsonFullLoadEndedOnValue : FullLoadEndedOn : FullLoadEndedOn;} + {_fullLoadTotalRow = If( json?.PropertyT("fullLoadTotalRows"), out var __jsonFullLoadTotalRows) ? (long?)__jsonFullLoadTotalRows : FullLoadTotalRow;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_totalChangesApplied = If( json?.PropertyT("totalChangesApplied"), out var __jsonTotalChangesApplied) ? (long?)__jsonTotalChangesApplied : TotalChangesApplied;} + {_dataErrorsCounter = If( json?.PropertyT("dataErrorsCounter"), out var __jsonDataErrorsCounter) ? (long?)__jsonDataErrorsCounter : DataErrorsCounter;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tableName.ToString()) : null, "tableName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcInsertCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcInsertCounter) : null, "cdcInsertCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcUpdateCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcUpdateCounter) : null, "cdcUpdateCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cdcDeleteCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._cdcDeleteCounter) : null, "cdcDeleteCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEstFinishTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEstFinishTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEstFinishTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadStartedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadStartedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadStartedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadEndedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fullLoadEndedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "fullLoadEndedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullLoadTotalRow ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._fullLoadTotalRow) : null, "fullLoadTotalRows" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalChangesApplied ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._totalChangesApplied) : null, "totalChangesApplied" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataErrorsCounter ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataErrorsCounter) : null, "dataErrorsCounter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..c0ffed44f475 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskPropertiesTypeConverter))] + public partial class MigrateSqlServerSqlDbSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbSyncTaskPropertiesTypeConverter))] + public partial interface IMigrateSqlServerSqlDbSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..1f7947b096db --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.cs new file mode 100644 index 000000000000..74f46cb9e52d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + public partial class MigrateSqlServerSqlDbSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public MigrateSqlServerSqlDbSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + public partial interface IMigrateSqlServerSqlDbSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputTableLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputError),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutputDatabaseError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput[] Output { get; } + + } + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + internal partial interface IMigrateSqlServerSqlDbSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.json.cs new file mode 100644 index 000000000000..4ca33b02345e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbSyncTaskProperties.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations + /// + public partial class MigrateSqlServerSqlDbSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbSyncTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.PowerShell.cs new file mode 100644 index 000000000000..fb5f188df5b8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.PowerShell.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskInputTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions) content.GetValueForProperty("ValidationOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).StartedOn = (string) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).StartedOn, global::System.Convert.ToString); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationOptionEnableSchemaValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableSchemaValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableSchemaValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableSchemaValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableDataIntegrityValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableDataIntegrityValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableQueryAnalysisValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableQueryAnalysisValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions) content.GetValueForProperty("ValidationOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).StartedOn = (string) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).StartedOn, global::System.Convert.ToString); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationOptionEnableSchemaValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableSchemaValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableSchemaValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableSchemaValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableDataIntegrityValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableDataIntegrityValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableDataIntegrityValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationOptionEnableQueryAnalysisValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation = (bool?) content.GetValueForProperty("ValidationOptionEnableQueryAnalysisValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal)this).ValidationOptionEnableQueryAnalysisValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskInputTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..e0f099f01d17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.cs new file mode 100644 index 000000000000..012b33768930 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + public partial class MigrateSqlServerSqlDbTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(); + + /// Backing field for property. + private string _encryptedKeyForSecureField; + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EncryptedKeyForSecureField { get => this._encryptedKeyForSecureField; set => this._encryptedKeyForSecureField = value; } + + /// Internal Acessors for ValidationOption + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInputInternal.ValidationOption { get => (this._validationOption = this._validationOption ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions()); set { {_validationOption = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName = value ?? null; } + + /// Backing field for property. + private string _startedOn; + + /// Date and time relative to UTC when the migration was started on + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StartedOn { get => this._startedOn; set => this._startedOn = value; } + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions _validationOption; + + /// + /// Options for enabling various post migration validations. Available options, + /// 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure + /// the correctness of the data. + /// 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list + /// of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically + /// either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and + /// target database. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions ValidationOption { get => (this._validationOption = this._validationOption ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions()); set => this._validationOption = value; } + + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ValidationOptionEnableDataIntegrityValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableDataIntegrityValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableDataIntegrityValidation = value ?? default(bool); } + + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ValidationOptionEnableQueryAnalysisValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableQueryAnalysisValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableQueryAnalysisValidation = value ?? default(bool); } + + /// Allows to compare the schema information between source and target. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ValidationOptionEnableSchemaValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableSchemaValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)ValidationOption).EnableSchemaValidation = value ?? default(bool); } + + /// Creates an new instance. + public MigrateSqlServerSqlDbTaskInput() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + await eventListener.AssertObjectIsValid(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + } + } + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database + public partial interface IMigrateSqlServerSqlDbTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput + { + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string EncryptedKeyForSecureField { get; set; } + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput[] SelectedDatabase { get; set; } + /// Date and time relative to UTC when the migration was started on + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time relative to UTC when the migration was started on", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(string) })] + string StartedOn { get; set; } + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to perform a checksum based data integrity validation between source and target for the selected database / tables .", + SerializedName = @"enableDataIntegrityValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidationOptionEnableDataIntegrityValidation { get; set; } + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries.", + SerializedName = @"enableQueryAnalysisValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidationOptionEnableQueryAnalysisValidation { get; set; } + /// Allows to compare the schema information between source and target. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to compare the schema information between source and target.", + SerializedName = @"enableSchemaValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidationOptionEnableSchemaValidation { get; set; } + + } + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database + internal partial interface IMigrateSqlServerSqlDbTaskInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal + { + /// encrypted key for secure fields + string EncryptedKeyForSecureField { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput[] SelectedDatabase { get; set; } + /// Date and time relative to UTC when the migration was started on + string StartedOn { get; set; } + /// + /// Options for enabling various post migration validations. Available options, + /// 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure + /// the correctness of the data. + /// 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list + /// of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically + /// either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and + /// target database. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions ValidationOption { get; set; } + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + bool? ValidationOptionEnableDataIntegrityValidation { get; set; } + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + bool? ValidationOptionEnableQueryAnalysisValidation { get; set; } + /// Allows to compare the schema information between source and target. + bool? ValidationOptionEnableSchemaValidation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.json.cs new file mode 100644 index 000000000000..02d51a523ccb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskInput.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + public partial class MigrateSqlServerSqlDbTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(json); + {_validationOption = If( json?.PropertyT("validationOptions"), out var __jsonValidationOptions) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationOptions.FromJson(__jsonValidationOptions) : ValidationOption;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? (string)__jsonStartedOn : (string)StartedOn;} + {_encryptedKeyForSecureField = If( json?.PropertyT("encryptedKeyForSecureFields"), out var __jsonEncryptedKeyForSecureFields) ? (string)__jsonEncryptedKeyForSecureFields : (string)EncryptedKeyForSecureField;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __sqlMigrationTaskInput?.ToJson(container, serializationMode); + AddIf( null != this._validationOption ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._validationOption.ToJson(null,serializationMode) : null, "validationOptions" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AddIf( null != (((object)this._startedOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn.ToString()) : null, "startedOn" ,container.Add ); + AddIf( null != (((object)this._encryptedKeyForSecureField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._encryptedKeyForSecureField.ToString()) : null, "encryptedKeyForSecureFields" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..7d016b011f74 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..092b7cbf2655 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.cs new file mode 100644 index 000000000000..f09594f88bb8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + public partial class MigrateSqlServerSqlDbTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Creates an new instance. + public MigrateSqlServerSqlDbTaskOutput() + { + + } + } + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database + public partial interface IMigrateSqlServerSqlDbTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database + internal partial interface IMigrateSqlServerSqlDbTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.json.cs new file mode 100644 index 000000000000..62e5e13b57c3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutput.json.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + public partial class MigrateSqlServerSqlDbTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateSqlServerSqlDbTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateSqlServerSqlDbTaskOutputDatabaseLevel(json); + } + case "TableLevelOutput": + { + return new MigrateSqlServerSqlDbTaskOutputTableLevel(json); + } + case "ErrorOutput": + { + return new MigrateSqlServerSqlDbTaskOutputError(json); + } + case "MigrationValidationOutput": + { + return new MigrateSqlServerSqlDbTaskOutputValidationResult(json); + } + case "MigrationDatabaseLevelValidationOutput": + { + return new MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(json); + } + } + return new MigrateSqlServerSqlDbTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..7c941bdee2bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("NumberOfObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObject = (long?) content.GetValueForProperty("NumberOfObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObject, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NumberOfObjectsCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted = (long?) content.GetValueForProperty("NumberOfObjectsCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorCount = (long?) content.GetValueForProperty("ErrorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ObjectSummary = (string) content.GetValueForProperty("ObjectSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ObjectSummary, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("NumberOfObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObject = (long?) content.GetValueForProperty("NumberOfObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObject, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NumberOfObjectsCompleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted = (long?) content.GetValueForProperty("NumberOfObjectsCompleted",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).NumberOfObjectsCompleted, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorCount = (long?) content.GetValueForProperty("ErrorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ObjectSummary = (string) content.GetValueForProperty("ObjectSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal)this).ObjectSummary, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..d5ad28884ba1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..f6f9ab8c6931 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(); + + /// Backing field for property. + private string _databaseName; + + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private long? _errorCount; + + /// Number of database/object errors. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ErrorCount { get => this._errorCount; } + + /// Backing field for property. + private string _errorPrefix; + + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorPrefix { get => this._errorPrefix; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ErrorCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.ErrorCount { get => this._errorCount; set { {_errorCount = value;} } } + + /// Internal Acessors for ErrorPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.ErrorPrefix { get => this._errorPrefix; set { {_errorPrefix = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for NumberOfObject + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.NumberOfObject { get => this._numberOfObject; set { {_numberOfObject = value;} } } + + /// Internal Acessors for NumberOfObjectsCompleted + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.NumberOfObjectsCompleted { get => this._numberOfObjectsCompleted; set { {_numberOfObjectsCompleted = value;} } } + + /// Internal Acessors for ObjectSummary + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.ObjectSummary { get => this._objectSummary; set { {_objectSummary = value;} } } + + /// Internal Acessors for ResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.ResultPrefix { get => this._resultPrefix; set { {_resultPrefix = value;} } } + + /// Internal Acessors for Stage + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.Stage { get => this._stage; set { {_stage = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id = value; } + + /// Backing field for property. + private long? _numberOfObject; + + /// Number of objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? NumberOfObject { get => this._numberOfObject; } + + /// Backing field for property. + private long? _numberOfObjectsCompleted; + + /// Number of successfully completed objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? NumberOfObjectsCompleted { get => this._numberOfObjectsCompleted; } + + /// Backing field for property. + private string _objectSummary; + + /// Summary of object results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ObjectSummary { get => this._objectSummary; } + + /// Backing field for property. + private string _resultPrefix; + + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultPrefix { get => this._resultPrefix; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? _stage; + + /// Migration stage that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get => this._stage; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private string _statusMessage; + + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StatusMessage { get => this._statusMessage; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput + { + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the item", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Number of database/object errors. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of database/object errors.", + SerializedName = @"errorCount", + PossibleTypes = new [] { typeof(long) })] + long? ErrorCount { get; } + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all errors of the item", + SerializedName = @"errorPrefix", + PossibleTypes = new [] { typeof(string) })] + string ErrorPrefix { get; } + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings.", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Number of objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of objects", + SerializedName = @"numberOfObjects", + PossibleTypes = new [] { typeof(long) })] + long? NumberOfObject { get; } + /// Number of successfully completed objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of successfully completed objects", + SerializedName = @"numberOfObjectsCompleted", + PossibleTypes = new [] { typeof(long) })] + long? NumberOfObjectsCompleted { get; } + /// Summary of object results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Summary of object results in the migration", + SerializedName = @"objectSummary", + PossibleTypes = new [] { typeof(string) })] + string ObjectSummary { get; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all sub-tem results of the item", + SerializedName = @"resultPrefix", + PossibleTypes = new [] { typeof(string) })] + string ResultPrefix { get; } + /// Migration stage that this database is in + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration stage that this database is in", + SerializedName = @"stage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status message", + SerializedName = @"statusMessage", + PossibleTypes = new [] { typeof(string) })] + string StatusMessage { get; } + + } + internal partial interface IMigrateSqlServerSqlDbTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal + { + /// Name of the item + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Number of database/object errors. + long? ErrorCount { get; set; } + /// Wildcard string prefix to use for querying all errors of the item + string ErrorPrefix { get; set; } + /// Migration exceptions and warnings. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Migration progress message + string Message { get; set; } + /// Number of objects + long? NumberOfObject { get; set; } + /// Number of successfully completed objects + long? NumberOfObjectsCompleted { get; set; } + /// Summary of object results in the migration + string ObjectSummary { get; set; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + string ResultPrefix { get; set; } + /// Migration stage that this database is in + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Status message + string StatusMessage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..2afa78596c58 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)Stage;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_numberOfObject = If( json?.PropertyT("numberOfObjects"), out var __jsonNumberOfObjects) ? (long?)__jsonNumberOfObjects : NumberOfObject;} + {_numberOfObjectsCompleted = If( json?.PropertyT("numberOfObjectsCompleted"), out var __jsonNumberOfObjectsCompleted) ? (long?)__jsonNumberOfObjectsCompleted : NumberOfObjectsCompleted;} + {_errorCount = If( json?.PropertyT("errorCount"), out var __jsonErrorCount) ? (long?)__jsonErrorCount : ErrorCount;} + {_errorPrefix = If( json?.PropertyT("errorPrefix"), out var __jsonErrorPrefix) ? (string)__jsonErrorPrefix : (string)ErrorPrefix;} + {_resultPrefix = If( json?.PropertyT("resultPrefix"), out var __jsonResultPrefix) ? (string)__jsonResultPrefix : (string)ResultPrefix;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + {_objectSummary = If( json?.PropertyT("objectSummary"), out var __jsonObjectSummary) ? (string)__jsonObjectSummary : (string)ObjectSummary;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._stage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stage.ToString()) : null, "stage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfObject ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._numberOfObject) : null, "numberOfObjects" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfObjectsCompleted ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._numberOfObjectsCompleted) : null, "numberOfObjectsCompleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._errorCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._errorCount) : null, "errorCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorPrefix.ToString()) : null, "errorPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resultPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultPrefix.ToString()) : null, "resultPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectSummary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectSummary.ToString()) : null, "objectSummary" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.PowerShell.cs new file mode 100644 index 000000000000..5735abc3b64f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.PowerShell.cs @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("DataIntegrityValidationResultFailedObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) content.GetValueForProperty("DataIntegrityValidationResultFailedObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjectsTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("DataIntegrityValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("SchemaValidationResultSchemaDifference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType) content.GetValueForProperty("SchemaValidationResultSchemaDifference",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("SchemaValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultSourceDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultSourceDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultTargetDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultTargetDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaDifferenceObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("SchemaDifferenceObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("SchemaValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("QueryAnalysisValidationResultQueryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult) content.GetValueForProperty("QueryAnalysisValidationResultQueryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("QueryAnalysisValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText = (string) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName = (string) content.GetValueForProperty("SchemaDifferenceObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceUpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("SchemaDifferenceUpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText = (string) content.GetValueForProperty("SchemaValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultSourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultSourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultTargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultTargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultQueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText = (string) content.GetValueForProperty("QueryResultQueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultStatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch = (long?) content.GetValueForProperty("QueryResultStatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText = (string) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DataIntegrityValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult) content.GetValueForProperty("DataIntegrityValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult) content.GetValueForProperty("SchemaValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult) content.GetValueForProperty("QueryAnalysisValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryAnalysisValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("DataIntegrityValidationResultFailedObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) content.GetValueForProperty("DataIntegrityValidationResultFailedObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjectsTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("DataIntegrityValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("SchemaValidationResultSchemaDifference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType) content.GetValueForProperty("SchemaValidationResultSchemaDifference",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("SchemaValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultSourceDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultSourceDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultTargetDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultTargetDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaDifferenceObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("SchemaDifferenceObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("SchemaValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("QueryAnalysisValidationResultQueryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult) content.GetValueForProperty("QueryAnalysisValidationResultQueryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("QueryAnalysisValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText = (string) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName = (string) content.GetValueForProperty("SchemaDifferenceObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceUpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("SchemaDifferenceUpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText = (string) content.GetValueForProperty("SchemaValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultSourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultSourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultTargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultTargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultQueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText = (string) content.GetValueForProperty("QueryResultQueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultStatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch = (long?) content.GetValueForProperty("QueryResultStatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText = (string) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DataIntegrityValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult) content.GetValueForProperty("DataIntegrityValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult) content.GetValueForProperty("SchemaValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult) content.GetValueForProperty("QueryAnalysisValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryAnalysisValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.TypeConverter.cs new file mode 100644 index 000000000000..16be3f1e561d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is + /// no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.cs new file mode 100644 index 000000000000..ed5d0902a4cb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(); + + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult __migrationValidationDatabaseLevelResult = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationDatabaseLevelResult(); + + /// + /// Provides data integrity validation result between the source and target tables that are migrated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult DataIntegrityValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResult; } + + /// List of failed table names of source and target pair + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects DataIntegrityValidationResultFailedObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultFailedObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultFailedObject = value ?? null /* model class */; } + + /// List of errors that happened while performing data integrity validation + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError DataIntegrityValidationResultValidationError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultValidationError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultValidationError = value ?? null /* model class */; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? DataIntegrityValidationResultValidationErrorsSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultValidationErrorsSeverity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultValidationErrorsSeverity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string DataIntegrityValidationResultValidationErrorsText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultValidationErrorsText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResultValidationErrorsText = value ?? null; } + + /// Validation end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).EndedOn; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id = value; } + + /// Internal Acessors for DataIntegrityValidationResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.DataIntegrityValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).DataIntegrityValidationResult = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.EndedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).EndedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).EndedOn = value; } + + /// Internal Acessors for MigrationId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.MigrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).MigrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).MigrationId = value; } + + /// Internal Acessors for QueryAnalysisValidationResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.QueryAnalysisValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResult = value; } + + /// Internal Acessors for SchemaValidationResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.SchemaValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResult = value; } + + /// Internal Acessors for SourceDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceDatabaseName = value; } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).StartedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).StartedOn = value; } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).Status = value; } + + /// Internal Acessors for TargetDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.TargetDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetDatabaseName = value; } + + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).MigrationId; } + + /// + /// Results of some of the query execution result between source and target database + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult QueryAnalysisValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResult; } + + /// List of queries executed and it's execution results in source and target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult QueryAnalysisValidationResultQueryResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultQueryResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultQueryResult = value ?? null /* model class */; } + + /// Errors that are part of the execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError QueryAnalysisValidationResultValidationError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultValidationError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultValidationError = value ?? null /* model class */; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? QueryAnalysisValidationResultValidationErrorsSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultValidationErrorsSeverity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultValidationErrorsSeverity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string QueryAnalysisValidationResultValidationErrorsText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultValidationErrorsText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryAnalysisValidationResultValidationErrorsText = value ?? null; } + + /// Query text retrieved from the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string QueryResultQueryText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultQueryText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultQueryText = value ?? null; } + + /// Query analysis result from the source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics QueryResultSourceResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultSourceResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultSourceResult = value ?? null /* model class */; } + + /// Total no. of statements in the batch + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long? QueryResultStatementsInBatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultStatementsInBatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultStatementsInBatch = value ?? default(long); } + + /// Query analysis result from the target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics QueryResultTargetResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultTargetResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).QueryResultTargetResult = value ?? null /* model class */; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Name of the object that has the difference + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SchemaDifferenceObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaDifferenceObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaDifferenceObjectName = value ?? null; } + + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? SchemaDifferenceObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaDifferenceObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaDifferenceObjectType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType)""); } + + /// Update action type with respect to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? SchemaDifferenceUpdateAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaDifferenceUpdateAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaDifferenceUpdateAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType)""); } + + /// Provides schema comparison result between source and target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult SchemaValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResult; } + + /// List of schema differences between the source and target databases + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType SchemaValidationResultSchemaDifference { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultSchemaDifference; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultSchemaDifference = value ?? null /* model class */; } + + /// Count of source database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount SchemaValidationResultSourceDatabaseObjectCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultSourceDatabaseObjectCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultSourceDatabaseObjectCount = value ?? null /* model class */; } + + /// Count of target database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount SchemaValidationResultTargetDatabaseObjectCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultTargetDatabaseObjectCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultTargetDatabaseObjectCount = value ?? null /* model class */; } + + /// List of errors that happened while performing schema compare validation + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError SchemaValidationResultValidationError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultValidationError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultValidationError = value ?? null /* model class */; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? SchemaValidationResultValidationErrorsSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultValidationErrorsSeverity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultValidationErrorsSeverity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SchemaValidationResultValidationErrorsText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultValidationErrorsText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SchemaValidationResultValidationErrorsText = value ?? null; } + + /// Name of the source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceDatabaseName; } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public float? SourceResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultCpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultCpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public float? SourceResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long? SourceResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultHasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultHasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string[] SourceResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultSqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultSqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultWaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).SourceResultWaitStat = value ?? null /* model class */; } + + /// Validation start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? StartedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).StartedOn; } + + /// Current status of validation at the database level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).Status; } + + /// Name of the target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetDatabaseName; } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public float? TargetResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultCpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultCpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public float? TargetResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long? TargetResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultHasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultHasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string[] TargetResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultSqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultSqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultWaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)__migrationValidationDatabaseLevelResult).TargetResultWaitStat = value ?? null /* model class */; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertNotNull(nameof(__migrationValidationDatabaseLevelResult), __migrationValidationDatabaseLevelResult); + await eventListener.AssertObjectIsValid(nameof(__migrationValidationDatabaseLevelResult), __migrationValidationDatabaseLevelResult); + } + } + public partial interface IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult + { + + } + internal partial interface IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.json.cs new file mode 100644 index 000000000000..9ba1db52e907 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(json); + __migrationValidationDatabaseLevelResult = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationDatabaseLevelResult(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + __migrationValidationDatabaseLevelResult?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..4605aefc915a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputErrorTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputErrorTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..7ce67e26f18a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.cs new file mode 100644 index 000000000000..14ca5aceb2a8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// Creates an new instance. + public MigrateSqlServerSqlDbTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateSqlServerSqlDbTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.json.cs new file mode 100644 index 000000000000..c26cbe8a35d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputError.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..955cb528fde5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult) content.GetValueForProperty("MigrationValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationReportResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult) content.GetValueForProperty("MigrationReportResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResultTypeConverter.ConvertFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DurationInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DurationInSecond = (long?) content.GetValueForProperty("DurationInSecond",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DurationInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("DatabaseSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DatabaseSummary = (string) content.GetValueForProperty("DatabaseSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DatabaseSummary, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationValidationResultMigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultMigrationId = (string) content.GetValueForProperty("MigrationValidationResultMigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultMigrationId, global::System.Convert.ToString); + } + if (content.Contains("MigrationValidationResultSummaryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultSummaryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) content.GetValueForProperty("MigrationValidationResultSummaryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultSummaryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResultsTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationReportResultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultId = (string) content.GetValueForProperty("MigrationReportResultId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultId, global::System.Convert.ToString); + } + if (content.Contains("MigrationReportResultReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl = (string) content.GetValueForProperty("MigrationReportResultReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl, global::System.Convert.ToString); + } + if (content.Contains("MigrationValidationResultStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("MigrationValidationResultStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultStatus, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult) content.GetValueForProperty("MigrationValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationReportResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult) content.GetValueForProperty("MigrationReportResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResultTypeConverter.ConvertFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DurationInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DurationInSecond = (long?) content.GetValueForProperty("DurationInSecond",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DurationInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("DatabaseSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DatabaseSummary = (string) content.GetValueForProperty("DatabaseSummary",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).DatabaseSummary, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationValidationResultMigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultMigrationId = (string) content.GetValueForProperty("MigrationValidationResultMigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultMigrationId, global::System.Convert.ToString); + } + if (content.Contains("MigrationValidationResultSummaryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultSummaryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) content.GetValueForProperty("MigrationValidationResultSummaryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultSummaryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResultsTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationReportResultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultId = (string) content.GetValueForProperty("MigrationReportResultId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultId, global::System.Convert.ToString); + } + if (content.Contains("MigrationReportResultReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl = (string) content.GetValueForProperty("MigrationReportResultReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationReportResultReportUrl, global::System.Convert.ToString); + } + if (content.Contains("MigrationValidationResultStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("MigrationValidationResultStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal)this).MigrationValidationResultStatus, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..d59cf51b0909 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..c854350acbc1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.cs @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(); + + /// Backing field for property. + private string _database; + + /// Selected databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Database { get => this._database; } + + /// Backing field for property. + private string _databaseSummary; + + /// Summary of database results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseSummary { get => this._databaseSummary; } + + /// Backing field for property. + private long? _durationInSecond; + + /// Duration of task execution in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DurationInSecond { get => this._durationInSecond; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id = value; } + + /// Internal Acessors for Database + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for DatabaseSummary + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.DatabaseSummary { get => this._databaseSummary; set { {_databaseSummary = value;} } } + + /// Internal Acessors for DurationInSecond + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.DurationInSecond { get => this._durationInSecond; set { {_durationInSecond = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for MigrationReportResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.MigrationReportResult { get => (this._migrationReportResult = this._migrationReportResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult()); set { {_migrationReportResult = value;} } } + + /// Internal Acessors for MigrationValidationResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.MigrationValidationResult { get => (this._migrationValidationResult = this._migrationValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResult()); set { {_migrationValidationResult = value;} } } + + /// Internal Acessors for MigrationValidationResultMigrationId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.MigrationValidationResultMigrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).MigrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).MigrationId = value; } + + /// Internal Acessors for MigrationValidationResultStatus + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.MigrationValidationResultStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).Status = value; } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult _migrationReportResult; + + /// + /// Migration Report Result, provides unique url for downloading your migration report. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult MigrationReportResult { get => (this._migrationReportResult = this._migrationReportResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult()); set => this._migrationReportResult = value; } + + /// Migration validation result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationReportResultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).Id = value ?? null; } + + /// The url of the report. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationReportResultReportUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).ReportUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)MigrationReportResult).ReportUrl = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult _migrationValidationResult; + + /// Migration Validation Results + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult MigrationValidationResult { get => (this._migrationValidationResult = this._migrationValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResult()); set => this._migrationValidationResult = value; } + + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MigrationValidationResultMigrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).MigrationId; } + + /// + /// Current status of validation at the migration level. Status from the database validation result status will be aggregated + /// here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? MigrationValidationResultStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).Status; } + + /// Validation summary results for each database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults MigrationValidationResultSummaryResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).SummaryResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)MigrationValidationResult).SummaryResult = value ?? null /* model class */; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? _status; + + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get => this._status; } + + /// Backing field for property. + private string _statusMessage; + + /// Migration status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StatusMessage { get => this._statusMessage; } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput + { + /// Selected databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Selected databases as a map from database name to database id", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string Database { get; } + /// Summary of database results in the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Summary of database results in the migration", + SerializedName = @"databaseSummary", + PossibleTypes = new [] { typeof(string) })] + string DatabaseSummary { get; } + /// Duration of task execution in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Duration of task execution in seconds.", + SerializedName = @"durationInSeconds", + PossibleTypes = new [] { typeof(long) })] + long? DurationInSecond { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings.", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Migration validation result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration validation result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string MigrationReportResultId { get; set; } + /// The url of the report. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url of the report.", + SerializedName = @"reportUrl", + PossibleTypes = new [] { typeof(string) })] + string MigrationReportResultReportUrl { get; set; } + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration Identifier", + SerializedName = @"migrationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationValidationResultMigrationId { get; } + /// + /// Current status of validation at the migration level. Status from the database validation result status will be aggregated + /// here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of validation at the migration level. Status from the database validation result status will be aggregated here.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? MigrationValidationResultStatus { get; } + /// Validation summary results for each database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Validation summary results for each database", + SerializedName = @"summaryResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults MigrationValidationResultSummaryResult { get; set; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of migration", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; } + /// Migration status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration status message", + SerializedName = @"statusMessage", + PossibleTypes = new [] { typeof(string) })] + string StatusMessage { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateSqlServerSqlDbTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal + { + /// Selected databases as a map from database name to database id + string Database { get; set; } + /// Summary of database results in the migration + string DatabaseSummary { get; set; } + /// Duration of task execution in seconds. + long? DurationInSecond { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Migration exceptions and warnings. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Migration progress message + string Message { get; set; } + /// + /// Migration Report Result, provides unique url for downloading your migration report. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult MigrationReportResult { get; set; } + /// Migration validation result identifier + string MigrationReportResultId { get; set; } + /// The url of the report. + string MigrationReportResultReportUrl { get; set; } + /// Migration Validation Results + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult MigrationValidationResult { get; set; } + /// Migration Identifier + string MigrationValidationResultMigrationId { get; set; } + /// + /// Current status of validation at the migration level. Status from the database validation result status will be aggregated + /// here. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? MigrationValidationResultStatus { get; set; } + /// Validation summary results for each database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults MigrationValidationResultSummaryResult { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current status of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; set; } + /// Migration status message + string StatusMessage { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..36a0ca68fb15 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.json.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(json); + {_migrationValidationResult = If( json?.PropertyT("migrationValidationResult"), out var __jsonMigrationValidationResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResult.FromJson(__jsonMigrationValidationResult) : MigrationValidationResult;} + {_migrationReportResult = If( json?.PropertyT("migrationReportResult"), out var __jsonMigrationReportResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationReportResult.FromJson(__jsonMigrationReportResult) : MigrationReportResult;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_durationInSecond = If( json?.PropertyT("durationInSeconds"), out var __jsonDurationInSeconds) ? (long?)__jsonDurationInSeconds : DurationInSecond;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? (string)__jsonDatabases : (string)Database;} + {_databaseSummary = If( json?.PropertyT("databaseSummary"), out var __jsonDatabaseSummary) ? (string)__jsonDatabaseSummary : (string)DatabaseSummary;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + AddIf( null != this._migrationValidationResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationValidationResult.ToJson(null,serializationMode) : null, "migrationValidationResult" ,container.Add ); + AddIf( null != this._migrationReportResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationReportResult.ToJson(null,serializationMode) : null, "migrationReportResult" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._durationInSecond ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._durationInSecond) : null, "durationInSeconds" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._database)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._database.ToString()) : null, "databases" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseSummary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseSummary.ToString()) : null, "databaseSummary" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.PowerShell.cs new file mode 100644 index 000000000000..a38a7496968f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.PowerShell.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputTableLevelTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskOutputTableLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskOutputTableLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskOutputTableLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskOutputTableLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskOutputTableLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).StatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ItemsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCount = (long?) content.GetValueForProperty("ItemsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ItemsCompletedCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCompletedCount = (long?) content.GetValueForProperty("ItemsCompletedCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ItemsCompletedCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("ResultPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ResultPrefix = (string) content.GetValueForProperty("ResultPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal)this).ResultPrefix, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputTableLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskOutputTableLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.TypeConverter.cs new file mode 100644 index 000000000000..2f33077f77d0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskOutputTableLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskOutputTableLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputTableLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputTableLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.cs new file mode 100644 index 000000000000..3ee283bfe7a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private string _errorPrefix; + + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorPrefix { get => this._errorPrefix; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; } + + /// Backing field for property. + private long? _itemsCompletedCount; + + /// Number of successfully completed items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ItemsCompletedCount { get => this._itemsCompletedCount; } + + /// Backing field for property. + private long? _itemsCount; + + /// Number of items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? ItemsCount { get => this._itemsCount; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ErrorPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.ErrorPrefix { get => this._errorPrefix; set { {_errorPrefix = value;} } } + + /// Internal Acessors for ItemsCompletedCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.ItemsCompletedCount { get => this._itemsCompletedCount; set { {_itemsCompletedCount = value;} } } + + /// Internal Acessors for ItemsCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.ItemsCount { get => this._itemsCount; set { {_itemsCount = value;} } } + + /// Internal Acessors for ObjectName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.ObjectName { get => this._objectName; set { {_objectName = value;} } } + + /// Internal Acessors for ResultPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.ResultPrefix { get => this._resultPrefix; set { {_resultPrefix = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for StatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevelInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + + /// Backing field for property. + private string _objectName; + + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ObjectName { get => this._objectName; } + + /// Backing field for property. + private string _resultPrefix; + + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultPrefix { get => this._resultPrefix; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private string _statusMessage; + + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StatusMessage { get => this._statusMessage; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbTaskOutputTableLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlDbTaskOutputTableLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Wildcard string prefix to use for querying all errors of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all errors of the item", + SerializedName = @"errorPrefix", + PossibleTypes = new [] { typeof(string) })] + string ErrorPrefix { get; } + /// Number of successfully completed items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of successfully completed items", + SerializedName = @"itemsCompletedCount", + PossibleTypes = new [] { typeof(long) })] + long? ItemsCompletedCount { get; } + /// Number of items + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of items", + SerializedName = @"itemsCount", + PossibleTypes = new [] { typeof(long) })] + long? ItemsCount { get; } + /// Name of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the item", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string ObjectName { get; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Wildcard string prefix to use for querying all sub-tem results of the item", + SerializedName = @"resultPrefix", + PossibleTypes = new [] { typeof(string) })] + string ResultPrefix { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Status message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status message", + SerializedName = @"statusMessage", + PossibleTypes = new [] { typeof(string) })] + string StatusMessage { get; } + + } + internal partial interface IMigrateSqlServerSqlDbTaskOutputTableLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Wildcard string prefix to use for querying all errors of the item + string ErrorPrefix { get; set; } + /// Number of successfully completed items + long? ItemsCompletedCount { get; set; } + /// Number of items + long? ItemsCount { get; set; } + /// Name of the item + string ObjectName { get; set; } + /// Wildcard string prefix to use for querying all sub-tem results of the item + string ResultPrefix { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Status message + string StatusMessage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.json.cs new file mode 100644 index 000000000000..83c2ca92a3d3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputTableLevel.json.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputTableLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskOutputTableLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskOutputTableLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(json); + {_objectName = If( json?.PropertyT("objectName"), out var __jsonObjectName) ? (string)__jsonObjectName : (string)ObjectName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_itemsCount = If( json?.PropertyT("itemsCount"), out var __jsonItemsCount) ? (long?)__jsonItemsCount : ItemsCount;} + {_itemsCompletedCount = If( json?.PropertyT("itemsCompletedCount"), out var __jsonItemsCompletedCount) ? (long?)__jsonItemsCompletedCount : ItemsCompletedCount;} + {_errorPrefix = If( json?.PropertyT("errorPrefix"), out var __jsonErrorPrefix) ? (string)__jsonErrorPrefix : (string)ErrorPrefix;} + {_resultPrefix = If( json?.PropertyT("resultPrefix"), out var __jsonResultPrefix) ? (string)__jsonResultPrefix : (string)ResultPrefix;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectName.ToString()) : null, "objectName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._itemsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._itemsCount) : null, "itemsCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._itemsCompletedCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._itemsCompletedCount) : null, "itemsCompletedCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorPrefix.ToString()) : null, "errorPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resultPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultPrefix.ToString()) : null, "resultPrefix" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.PowerShell.cs new file mode 100644 index 000000000000..59cffdc1fd91 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.PowerShell.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputValidationResultTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskOutputValidationResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskOutputValidationResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskOutputValidationResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskOutputValidationResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SummaryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) content.GetValueForProperty("SummaryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResultsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskOutputValidationResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SummaryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) content.GetValueForProperty("SummaryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResultsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskOutputValidationResultTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskOutputValidationResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.TypeConverter.cs new file mode 100644 index 000000000000..0b67661766b6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskOutputValidationResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskOutputValidationResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputValidationResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskOutputValidationResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.cs new file mode 100644 index 000000000000..1cc2434dc202 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(); + + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult __migrationValidationResult = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResult(); + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).Id = value; } + + /// Internal Acessors for MigrationId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal.MigrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).MigrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).MigrationId = value; } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).Status = value; } + + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string MigrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).MigrationId; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal)__migrateSqlServerSqlDbTaskOutput).ResultType = value ; } + + /// + /// Current status of validation at the migration level. Status from the database validation result status will be aggregated + /// here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).Status; } + + /// Validation summary results for each database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults SummaryResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).SummaryResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)__migrationValidationResult).SummaryResult = value ?? null /* model class */; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlDbTaskOutputValidationResult() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlDbTaskOutput), __migrateSqlServerSqlDbTaskOutput); + await eventListener.AssertNotNull(nameof(__migrationValidationResult), __migrationValidationResult); + await eventListener.AssertObjectIsValid(nameof(__migrationValidationResult), __migrationValidationResult); + } + } + public partial interface IMigrateSqlServerSqlDbTaskOutputValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult + { + + } + internal partial interface IMigrateSqlServerSqlDbTaskOutputValidationResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.json.cs new file mode 100644 index 000000000000..21dcaf282289 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskOutputValidationResult.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlDbTaskOutputValidationResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskOutputValidationResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskOutputValidationResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlDbTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput(json); + __migrationValidationResult = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResult(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlDbTaskOutput?.ToJson(container, serializationMode); + __migrationValidationResult?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..4df68418e39f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.PowerShell.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskPropertiesTypeConverter))] + public partial class MigrateSqlServerSqlDbTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlDbTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlDbTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlDbTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlDbTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlDbTaskPropertiesTypeConverter))] + public partial interface IMigrateSqlServerSqlDbTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..918e89a657df --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlDbTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlDbTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlDbTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.cs new file mode 100644 index 000000000000..1abaffc2c194 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + public partial class MigrateSqlServerSqlDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Backing field for property. + private string _createdOn; + + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CreatedOn { get => this._createdOn; set => this._createdOn = value; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskInput()); set => this._input = value; } + + /// Backing field for property. + private bool? _isCloneable; + + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsCloneable { get => this._isCloneable; set => this._isCloneable = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Backing field for property. + private string _taskId; + + /// task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public MigrateSqlServerSqlDbTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database + public partial interface IMigrateSqlServerSqlDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DateTime in UTC when the task was created", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(string) })] + string CreatedOn { get; set; } + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput Input { get; set; } + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether the task can be cloned or not", + SerializedName = @"isCloneable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputTableLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputError),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputValidationResult),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput[] Output { get; } + /// task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"task id", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database + internal partial interface IMigrateSqlServerSqlDbTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// DateTime in UTC when the task was created + string CreatedOn { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskInput Input { get; set; } + /// whether the task can be cloned or not + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput[] Output { get; set; } + /// task id + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.json.cs new file mode 100644 index 000000000000..1f99e001ecc9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlDbTaskProperties.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database + /// + public partial class MigrateSqlServerSqlDbTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlDbTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlDbTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_isCloneable = If( json?.PropertyT("isCloneable"), out var __jsonIsCloneable) ? (bool?)__jsonIsCloneable : IsCloneable;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? (string)__jsonCreatedOn : (string)CreatedOn;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != this._isCloneable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isCloneable) : null, "isCloneable" ,container.Add ); + AddIf( null != (((object)this._createdOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdOn.ToString()) : null, "createdOn" ,container.Add ); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.PowerShell.cs new file mode 100644 index 000000000000..50c78f11e6dc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiDatabaseInputTypeConverter))] + public partial class MigrateSqlServerSqlMiDatabaseInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiDatabaseInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiDatabaseInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiDatabaseInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RestoreDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).RestoreDatabaseName = (string) content.GetValueForProperty("RestoreDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).RestoreDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupFilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFilePath = (string[]) content.GetValueForProperty("BackupFilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFilePath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiDatabaseInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RestoreDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).RestoreDatabaseName = (string) content.GetValueForProperty("RestoreDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).RestoreDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("BackupFilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFilePath = (string[]) content.GetValueForProperty("BackupFilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFilePath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiDatabaseInputTypeConverter))] + public partial interface IMigrateSqlServerSqlMiDatabaseInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.TypeConverter.cs new file mode 100644 index 000000000000..ffb79b4c4ca8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiDatabaseInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiDatabaseInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiDatabaseInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiDatabaseInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.cs new file mode 100644 index 000000000000..f47a46777548 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs + /// + public partial class MigrateSqlServerSqlMiDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal + { + + /// Backing field for property. + private string[] _backupFilePath; + + /// The list of backup files to be used in case of existing backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] BackupFilePath { get => this._backupFilePath; set => this._backupFilePath = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare _backupFileShare; + + /// Backup file share information for backing up this database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set => this._backupFileShare = value; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName = value ?? null; } + + /// Backing field for property. + private string _id; + + /// id of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for BackupFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInputInternal.BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set { {_backupFileShare = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _restoreDatabaseName; + + /// Name of the database at destination + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string RestoreDatabaseName { get => this._restoreDatabaseName; set => this._restoreDatabaseName = value; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiDatabaseInput() + { + + } + } + /// Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs + public partial interface IMigrateSqlServerSqlMiDatabaseInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The list of backup files to be used in case of existing backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of backup files to be used in case of existing backups.", + SerializedName = @"backupFilePaths", + PossibleTypes = new [] { typeof(string) })] + string[] BackupFilePath { get; set; } + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string BackupFileShareUserName { get; set; } + /// id of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"id of the database", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Name of the database at destination + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the database at destination", + SerializedName = @"restoreDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string RestoreDatabaseName { get; set; } + + } + /// Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs + internal partial interface IMigrateSqlServerSqlMiDatabaseInputInternal + + { + /// The list of backup files to be used in case of existing backups. + string[] BackupFilePath { get; set; } + /// Backup file share information for backing up this database. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get; set; } + /// Password credential used to connect to the share location. + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + string BackupFileShareUserName { get; set; } + /// id of the database + string Id { get; set; } + /// Name of the database + string Name { get; set; } + /// Name of the database at destination + string RestoreDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.json.cs new file mode 100644 index 000000000000..e31d6c6b7f46 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiDatabaseInput.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs + /// + public partial class MigrateSqlServerSqlMiDatabaseInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiDatabaseInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiDatabaseInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupFileShare = If( json?.PropertyT("backupFileShare"), out var __jsonBackupFileShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare.FromJson(__jsonBackupFileShare) : BackupFileShare;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_restoreDatabaseName = If( json?.PropertyT("restoreDatabaseName"), out var __jsonRestoreDatabaseName) ? (string)__jsonRestoreDatabaseName : (string)RestoreDatabaseName;} + {_backupFilePath = If( json?.PropertyT("backupFilePaths"), out var __jsonBackupFilePaths) ? If( __jsonBackupFilePaths as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : BackupFilePath;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._backupFileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupFileShare.ToJson(null,serializationMode) : null, "backupFileShare" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._restoreDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._restoreDatabaseName.ToString()) : null, "restoreDatabaseName" ,container.Add ); + if (null != this._backupFilePath) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._backupFilePath ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("backupFilePaths",__w); + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..abe4cc7bff5d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.PowerShell.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskInputTypeConverter))] + public partial class MigrateSqlServerSqlMiSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NumberOfParallelDatabaseMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInputInternal)this).NumberOfParallelDatabaseMigration = (float?) content.GetValueForProperty("NumberOfParallelDatabaseMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInputInternal)this).NumberOfParallelDatabaseMigration, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NumberOfParallelDatabaseMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInputInternal)this).NumberOfParallelDatabaseMigration = (float?) content.GetValueForProperty("NumberOfParallelDatabaseMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInputInternal)this).NumberOfParallelDatabaseMigration, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskInputTypeConverter))] + public partial interface IMigrateSqlServerSqlMiSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..1104bd288ec3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.cs new file mode 100644 index 000000000000..0c98ced34372 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + public partial class MigrateSqlServerSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput __sqlServerSqlMiSyncTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput(); + + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureApp { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureApp; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureApp = value ; } + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string AzureAppApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppApplicationId = value ?? null; } + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? AzureAppIgnoreAzurePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppIgnoreAzurePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppIgnoreAzurePermission = value ?? default(bool); } + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string AzureAppKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppKey = value ?? null; } + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string AzureAppTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppTenantId = value ?? null; } + + /// Backup file share information for all selected databases. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShare = value ?? null /* model class */; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePassword = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePath = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShareUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShareUserName = value ?? null; } + + /// Backing field for property. + private float? _numberOfParallelDatabaseMigration; + + /// Number of database migrations to start in parallel + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public float? NumberOfParallelDatabaseMigration { get => this._numberOfParallelDatabaseMigration; set => this._numberOfParallelDatabaseMigration = value; } + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SelectedDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SelectedDatabase = value ; } + + /// Connection information for source SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoUserName = value ?? null; } + + /// Fully qualified resourceId of storage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string StorageResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).StorageResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).StorageResourceId = value ; } + + /// Connection information for Azure SQL Database Managed Instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfo = value ; } + + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoManagedInstanceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoManagedInstanceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoManagedInstanceResourceId = value ; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoPassword = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoUserName = value ?? null; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiSyncTaskInput() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__sqlServerSqlMiSyncTaskInput), __sqlServerSqlMiSyncTaskInput); + await eventListener.AssertObjectIsValid(nameof(__sqlServerSqlMiSyncTaskInput), __sqlServerSqlMiSyncTaskInput); + } + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + public partial interface IMigrateSqlServerSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput + { + /// Number of database migrations to start in parallel + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of database migrations to start in parallel", + SerializedName = @"numberOfParallelDatabaseMigrations", + PossibleTypes = new [] { typeof(float) })] + float? NumberOfParallelDatabaseMigration { get; set; } + + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + internal partial interface IMigrateSqlServerSqlMiSyncTaskInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal + { + /// Number of database migrations to start in parallel + float? NumberOfParallelDatabaseMigration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.json.cs new file mode 100644 index 000000000000..afabe4cdd060 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskInput.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + public partial class MigrateSqlServerSqlMiSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiSyncTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __sqlServerSqlMiSyncTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput(json); + {_numberOfParallelDatabaseMigration = If( json?.PropertyT("numberOfParallelDatabaseMigrations"), out var __jsonNumberOfParallelDatabaseMigrations) ? (float?)__jsonNumberOfParallelDatabaseMigrations : NumberOfParallelDatabaseMigration;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __sqlServerSqlMiSyncTaskInput?.ToJson(container, serializationMode); + AddIf( null != this._numberOfParallelDatabaseMigration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((float)this._numberOfParallelDatabaseMigration) : null, "numberOfParallelDatabaseMigrations" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..3f7397c0c37e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputTypeConverter))] + public partial class MigrateSqlServerSqlMiSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputTypeConverter))] + public partial interface IMigrateSqlServerSqlMiSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..d80c4587fbfc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.cs new file mode 100644 index 000000000000..c0d9c789bf9b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. + /// + public partial class MigrateSqlServerSqlMiSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiSyncTaskOutput() + { + + } + } + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. + public partial interface IMigrateSqlServerSqlMiSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. + internal partial interface IMigrateSqlServerSqlMiSyncTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.json.cs new file mode 100644 index 000000000000..a14e3ff13d95 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutput.json.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. + /// + public partial class MigrateSqlServerSqlMiSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel(json); + } + case "ErrorOutput": + { + return new MigrateSqlServerSqlMiSyncTaskOutputError(json); + } + } + return new MigrateSqlServerSqlMiSyncTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..9e595f4aeb7a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FullBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo) content.GetValueForProperty("FullBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("LastRestoredBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo) content.GetValueForProperty("LastRestoredBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActiveBackupSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ActiveBackupSet = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo[]) content.GetValueForProperty("ActiveBackupSet",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ActiveBackupSet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("IsFullBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).IsFullBackupRestored = (bool?) content.GetValueForProperty("IsFullBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).IsFullBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("FullBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("LastRestoredBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("FullBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupSetId = (string) content.GetValueForProperty("FullBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoFirstLsn = (string) content.GetValueForProperty("FullBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastLsn = (string) content.GetValueForProperty("FullBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[]) content.GetValueForProperty("FullBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("FullBackupSetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoDatabaseName = (string) content.GetValueForProperty("FullBackupSetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoBackupFinishedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupFinishedDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupFinishedDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupFinishedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("FullBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastRestoredBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupSetId = (string) content.GetValueForProperty("LastRestoredBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoFirstLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[]) content.GetValueForProperty("LastRestoredBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("LastRestoredBackupSetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoDatabaseName = (string) content.GetValueForProperty("LastRestoredBackupSetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupFinishedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupFinishedDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupFinishedDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupFinishedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("LastRestoredBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FullBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo) content.GetValueForProperty("FullBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("LastRestoredBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo) content.GetValueForProperty("LastRestoredBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActiveBackupSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ActiveBackupSet = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo[]) content.GetValueForProperty("ActiveBackupSet",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ActiveBackupSet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ErrorPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ErrorPrefix = (string) content.GetValueForProperty("ErrorPrefix",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ErrorPrefix, global::System.Convert.ToString); + } + if (content.Contains("IsFullBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).IsFullBackupRestored = (bool?) content.GetValueForProperty("IsFullBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).IsFullBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("FullBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("LastRestoredBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("FullBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupSetId = (string) content.GetValueForProperty("FullBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoFirstLsn = (string) content.GetValueForProperty("FullBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastLsn = (string) content.GetValueForProperty("FullBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[]) content.GetValueForProperty("FullBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("FullBackupSetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoDatabaseName = (string) content.GetValueForProperty("FullBackupSetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoBackupFinishedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupFinishedDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupFinishedDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoBackupFinishedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("FullBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).FullBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastRestoredBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupSetId = (string) content.GetValueForProperty("LastRestoredBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoFirstLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[]) content.GetValueForProperty("LastRestoredBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("LastRestoredBackupSetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoDatabaseName = (string) content.GetValueForProperty("LastRestoredBackupSetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupFinishedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupFinishedDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupFinishedDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoBackupFinishedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("LastRestoredBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal)this).LastRestoredBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..2c78be6ebed2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..63bb49275b73 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.cs @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput __migrateSqlServerSqlMiSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo[] _activeBackupSet; + + /// + /// Backup sets that are currently active (Either being uploaded or getting restored) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo[] ActiveBackupSet { get => this._activeBackupSet; } + + /// Backing field for property. + private string _containerName; + + /// + /// Name of container created in the Azure Storage account where backups are copied to + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Database migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private string _errorPrefix; + + /// prefix string to use for querying errors for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ErrorPrefix { get => this._errorPrefix; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo _fullBackupSetInfo; + + /// Details of full backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo FullBackupSetInfo { get => (this._fullBackupSetInfo = this._fullBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo()); } + + /// Date and time that the backup operation finished + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? FullBackupSetInfoBackupFinishedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupFinishedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupFinishedDate = value ?? default(global::System.DateTime); } + + /// Id for the set of backup files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoBackupSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupSetId = value ?? null; } + + /// Date and time that the backup operation began + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? FullBackupSetInfoBackupStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupStartDate = value ?? default(global::System.DateTime); } + + /// Enum of the different backup types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? FullBackupSetInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).BackupType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType)""); } + + /// Name of the database to which the backup set belongs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).DatabaseName = value ?? null; } + + /// First log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoFirstLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).FirstLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).FirstLsn = value ?? null; } + + /// Whether the backup set is restored or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? FullBackupSetInfoIsBackupRestored { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).IsBackupRestored; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).IsBackupRestored = value ?? default(bool); } + + /// Last log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoLastLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).LastLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).LastLsn = value ?? null; } + + /// Last modified time of the backup file in share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? FullBackupSetInfoLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).LastModifiedTime = value ?? default(global::System.DateTime); } + + /// List of files in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] FullBackupSetInfoListOfBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).ListOfBackupFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)FullBackupSetInfo).ListOfBackupFile = value ?? null /* arrayOf */; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id; } + + /// Backing field for property. + private bool? _isFullBackupRestored; + + /// Whether full backup has been applied to the target database or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsFullBackupRestored { get => this._isFullBackupRestored; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo _lastRestoredBackupSetInfo; + + /// Last applied backup set information + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo LastRestoredBackupSetInfo { get => (this._lastRestoredBackupSetInfo = this._lastRestoredBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo()); } + + /// Date and time that the backup operation finished + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? LastRestoredBackupSetInfoBackupFinishedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupFinishedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupFinishedDate = value ?? default(global::System.DateTime); } + + /// Id for the set of backup files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoBackupSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupSetId = value ?? null; } + + /// Date and time that the backup operation began + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? LastRestoredBackupSetInfoBackupStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupStartDate = value ?? default(global::System.DateTime); } + + /// Enum of the different backup types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? LastRestoredBackupSetInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType)""); } + + /// Name of the database to which the backup set belongs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).DatabaseName = value ?? null; } + + /// First log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoFirstLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).FirstLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).FirstLsn = value ?? null; } + + /// Whether the backup set is restored or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? LastRestoredBackupSetInfoIsBackupRestored { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).IsBackupRestored; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).IsBackupRestored = value ?? default(bool); } + + /// Last log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoLastLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).LastLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).LastLsn = value ?? null; } + + /// Last modified time of the backup file in share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? LastRestoredBackupSetInfoLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).LastModifiedTime = value ?? default(global::System.DateTime); } + + /// List of files in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] LastRestoredBackupSetInfoListOfBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).ListOfBackupFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfoInternal)LastRestoredBackupSetInfo).ListOfBackupFile = value ?? null /* arrayOf */; } + + /// Internal Acessors for ActiveBackupSet + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.ActiveBackupSet { get => this._activeBackupSet; set { {_activeBackupSet = value;} } } + + /// Internal Acessors for ContainerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.ContainerName { get => this._containerName; set { {_containerName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ErrorPrefix + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.ErrorPrefix { get => this._errorPrefix; set { {_errorPrefix = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for FullBackupSetInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.FullBackupSetInfo { get => (this._fullBackupSetInfo = this._fullBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo()); set { {_fullBackupSetInfo = value;} } } + + /// Internal Acessors for IsFullBackupRestored + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.IsFullBackupRestored { get => this._isFullBackupRestored; set { {_isFullBackupRestored = value;} } } + + /// Internal Acessors for LastRestoredBackupSetInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.LastRestoredBackupSetInfo { get => (this._lastRestoredBackupSetInfo = this._lastRestoredBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo()); set { {_lastRestoredBackupSetInfo = value;} } } + + /// Internal Acessors for MigrationState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for SourceDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.SourceDatabaseName { get => this._sourceDatabaseName; set { {_sourceDatabaseName = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState? _migrationState; + + /// Current state of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState? MigrationState { get => this._migrationState; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceDatabaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceDatabaseName { get => this._sourceDatabaseName; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Database migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiSyncTaskOutput), __migrateSqlServerSqlMiSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiSyncTaskOutput), __migrateSqlServerSqlMiSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput + { + /// + /// Backup sets that are currently active (Either being uploaded or getting restored) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup sets that are currently active (Either being uploaded or getting restored)", + SerializedName = @"activeBackupSets", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo[] ActiveBackupSet { get; } + /// + /// Name of container created in the Azure Storage account where backups are copied to + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of container created in the Azure Storage account where backups are copied to", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; } + /// Database migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// prefix string to use for querying errors for this database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"prefix string to use for querying errors for this database", + SerializedName = @"errorPrefix", + PossibleTypes = new [] { typeof(string) })] + string ErrorPrefix { get; } + /// Migration exceptions and warnings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Date and time that the backup operation finished + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time that the backup operation finished", + SerializedName = @"backupFinishedDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullBackupSetInfoBackupFinishedDate { get; set; } + /// Id for the set of backup files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the set of backup files", + SerializedName = @"backupSetId", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoBackupSetId { get; set; } + /// Date and time that the backup operation began + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time that the backup operation began", + SerializedName = @"backupStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullBackupSetInfoBackupStartDate { get; set; } + /// Enum of the different backup types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enum of the different backup types", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? FullBackupSetInfoBackupType { get; set; } + /// Name of the database to which the backup set belongs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database to which the backup set belongs", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoDatabaseName { get; set; } + /// First log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First log sequence number of the backup file", + SerializedName = @"firstLsn", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoFirstLsn { get; set; } + /// Whether the backup set is restored or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the backup set is restored or not", + SerializedName = @"isBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? FullBackupSetInfoIsBackupRestored { get; set; } + /// Last log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last log sequence number of the backup file", + SerializedName = @"lastLsn", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoLastLsn { get; set; } + /// Last modified time of the backup file in share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last modified time of the backup file in share location", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullBackupSetInfoLastModifiedTime { get; set; } + /// List of files in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of files in the backup set", + SerializedName = @"listOfBackupFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] FullBackupSetInfoListOfBackupFile { get; set; } + /// Whether full backup has been applied to the target database or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether full backup has been applied to the target database or not", + SerializedName = @"isFullBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? IsFullBackupRestored { get; } + /// Date and time that the backup operation finished + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time that the backup operation finished", + SerializedName = @"backupFinishedDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRestoredBackupSetInfoBackupFinishedDate { get; set; } + /// Id for the set of backup files + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the set of backup files", + SerializedName = @"backupSetId", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoBackupSetId { get; set; } + /// Date and time that the backup operation began + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time that the backup operation began", + SerializedName = @"backupStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRestoredBackupSetInfoBackupStartDate { get; set; } + /// Enum of the different backup types + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enum of the different backup types", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? LastRestoredBackupSetInfoBackupType { get; set; } + /// Name of the database to which the backup set belongs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database to which the backup set belongs", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoDatabaseName { get; set; } + /// First log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First log sequence number of the backup file", + SerializedName = @"firstLsn", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoFirstLsn { get; set; } + /// Whether the backup set is restored or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the backup set is restored or not", + SerializedName = @"isBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? LastRestoredBackupSetInfoIsBackupRestored { get; set; } + /// Last log sequence number of the backup file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last log sequence number of the backup file", + SerializedName = @"lastLsn", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoLastLsn { get; set; } + /// Last modified time of the backup file in share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last modified time of the backup file in share location", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRestoredBackupSetInfoLastModifiedTime { get; set; } + /// List of files in the backup set + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of files in the backup set", + SerializedName = @"listOfBackupFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] LastRestoredBackupSetInfoListOfBackupFile { get; set; } + /// Current state of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of database", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState? MigrationState { get; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; } + /// Database migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + + } + internal partial interface IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal + { + /// + /// Backup sets that are currently active (Either being uploaded or getting restored) + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo[] ActiveBackupSet { get; set; } + /// + /// Name of container created in the Azure Storage account where backups are copied to + /// + string ContainerName { get; set; } + /// Database migration end time + global::System.DateTime? EndedOn { get; set; } + /// prefix string to use for querying errors for this database + string ErrorPrefix { get; set; } + /// Migration exceptions and warnings + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Details of full backup set + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo FullBackupSetInfo { get; set; } + /// Date and time that the backup operation finished + global::System.DateTime? FullBackupSetInfoBackupFinishedDate { get; set; } + /// Id for the set of backup files + string FullBackupSetInfoBackupSetId { get; set; } + /// Date and time that the backup operation began + global::System.DateTime? FullBackupSetInfoBackupStartDate { get; set; } + /// Enum of the different backup types + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? FullBackupSetInfoBackupType { get; set; } + /// Name of the database to which the backup set belongs + string FullBackupSetInfoDatabaseName { get; set; } + /// First log sequence number of the backup file + string FullBackupSetInfoFirstLsn { get; set; } + /// Whether the backup set is restored or not + bool? FullBackupSetInfoIsBackupRestored { get; set; } + /// Last log sequence number of the backup file + string FullBackupSetInfoLastLsn { get; set; } + /// Last modified time of the backup file in share location + global::System.DateTime? FullBackupSetInfoLastModifiedTime { get; set; } + /// List of files in the backup set + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] FullBackupSetInfoListOfBackupFile { get; set; } + /// Whether full backup has been applied to the target database or not + bool? IsFullBackupRestored { get; set; } + /// Last applied backup set information + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo LastRestoredBackupSetInfo { get; set; } + /// Date and time that the backup operation finished + global::System.DateTime? LastRestoredBackupSetInfoBackupFinishedDate { get; set; } + /// Id for the set of backup files + string LastRestoredBackupSetInfoBackupSetId { get; set; } + /// Date and time that the backup operation began + global::System.DateTime? LastRestoredBackupSetInfoBackupStartDate { get; set; } + /// Enum of the different backup types + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? LastRestoredBackupSetInfoBackupType { get; set; } + /// Name of the database to which the backup set belongs + string LastRestoredBackupSetInfoDatabaseName { get; set; } + /// First log sequence number of the backup file + string LastRestoredBackupSetInfoFirstLsn { get; set; } + /// Whether the backup set is restored or not + bool? LastRestoredBackupSetInfoIsBackupRestored { get; set; } + /// Last log sequence number of the backup file + string LastRestoredBackupSetInfoLastLsn { get; set; } + /// Last modified time of the backup file in share location + global::System.DateTime? LastRestoredBackupSetInfoLastModifiedTime { get; set; } + /// List of files in the backup set + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupFileInfo[] LastRestoredBackupSetInfoListOfBackupFile { get; set; } + /// Current state of database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState? MigrationState { get; set; } + /// Name of the database + string SourceDatabaseName { get; set; } + /// Database migration start time + global::System.DateTime? StartedOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..e1ab6863ec4b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput(json); + {_fullBackupSetInfo = If( json?.PropertyT("fullBackupSetInfo"), out var __jsonFullBackupSetInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo.FromJson(__jsonFullBackupSetInfo) : FullBackupSetInfo;} + {_lastRestoredBackupSetInfo = If( json?.PropertyT("lastRestoredBackupSetInfo"), out var __jsonLastRestoredBackupSetInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo.FromJson(__jsonLastRestoredBackupSetInfo) : LastRestoredBackupSetInfo;} + {_sourceDatabaseName = If( json?.PropertyT("sourceDatabaseName"), out var __jsonSourceDatabaseName) ? (string)__jsonSourceDatabaseName : (string)SourceDatabaseName;} + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_activeBackupSet = If( json?.PropertyT("activeBackupSets"), out var __jsonActiveBackupSets) ? If( __jsonActiveBackupSets as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBackupSetInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BackupSetInfo.FromJson(__u) )) ))() : null : ActiveBackupSet;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_errorPrefix = If( json?.PropertyT("errorPrefix"), out var __jsonErrorPrefix) ? (string)__jsonErrorPrefix : (string)ErrorPrefix;} + {_isFullBackupRestored = If( json?.PropertyT("isFullBackupRestored"), out var __jsonIsFullBackupRestored) ? (bool?)__jsonIsFullBackupRestored : IsFullBackupRestored;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullBackupSetInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._fullBackupSetInfo.ToJson(null,serializationMode) : null, "fullBackupSetInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastRestoredBackupSetInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._lastRestoredBackupSetInfo.ToJson(null,serializationMode) : null, "lastRestoredBackupSetInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceDatabaseName.ToString()) : null, "sourceDatabaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._activeBackupSet) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._activeBackupSet ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("activeBackupSets",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._errorPrefix.ToString()) : null, "errorPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isFullBackupRestored ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isFullBackupRestored) : null, "isFullBackupRestored" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._exceptionsAndWarning ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("exceptionsAndWarnings",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..d1bbc35286b6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputErrorTypeConverter))] + public partial class MigrateSqlServerSqlMiSyncTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiSyncTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiSyncTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputErrorTypeConverter))] + public partial interface IMigrateSqlServerSqlMiSyncTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..762d8082a393 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiSyncTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiSyncTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.cs new file mode 100644 index 000000000000..d872181eb43a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput __migrateSqlServerSqlMiSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlMiSyncTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiSyncTaskOutput), __migrateSqlServerSqlMiSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiSyncTaskOutput), __migrateSqlServerSqlMiSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiSyncTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateSqlServerSqlMiSyncTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.json.cs new file mode 100644 index 000000000000..3d2d9d9b9bc5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputError.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiSyncTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiSyncTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiSyncTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..44a762a63694 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseCount = (int?) content.GetValueForProperty("DatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("DatabaseErrorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseErrorCount = (int?) content.GetValueForProperty("DatabaseErrorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseErrorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseCount = (int?) content.GetValueForProperty("DatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("DatabaseErrorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseErrorCount = (int?) content.GetValueForProperty("DatabaseErrorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal)this).DatabaseErrorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..0f7e8e96d85a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiSyncTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..da618479c13b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.cs @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput __migrateSqlServerSqlMiSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput(); + + /// Backing field for property. + private int? _databaseCount; + + /// Count of databases + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? DatabaseCount { get => this._databaseCount; } + + /// Backing field for property. + private int? _databaseErrorCount; + + /// Number of database level errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? DatabaseErrorCount { get => this._databaseErrorCount; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).Id = value; } + + /// Internal Acessors for DatabaseCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.DatabaseCount { get => this._databaseCount; set { {_databaseCount = value;} } } + + /// Internal Acessors for DatabaseErrorCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.DatabaseErrorCount { get => this._databaseErrorCount; set { {_databaseErrorCount = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.SourceServerName { get => this._sourceServerName; set { {_sourceServerName = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.TargetServerName { get => this._targetServerName; set { {_targetServerName = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal)__migrateSqlServerSqlMiSyncTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerName; + + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerName { get => this._sourceServerName; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerName; + + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerName { get => this._targetServerName; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiSyncTaskOutput), __migrateSqlServerSqlMiSyncTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiSyncTaskOutput), __migrateSqlServerSqlMiSyncTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput + { + /// Count of databases + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Count of databases", + SerializedName = @"databaseCount", + PossibleTypes = new [] { typeof(int) })] + int? DatabaseCount { get; } + /// Number of database level errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of database level errors", + SerializedName = @"databaseErrorCount", + PossibleTypes = new [] { typeof(int) })] + int? DatabaseErrorCount { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Source server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server name", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server name", + SerializedName = @"targetServerName", + PossibleTypes = new [] { typeof(string) })] + string TargetServerName { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputInternal + { + /// Count of databases + int? DatabaseCount { get; set; } + /// Number of database level errors + int? DatabaseErrorCount { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Source server name + string SourceServerName { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server name + string TargetServerName { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..67752266f2e7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel.json.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiSyncTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiSyncTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput(json); + {_databaseCount = If( json?.PropertyT("databaseCount"), out var __jsonDatabaseCount) ? (int?)__jsonDatabaseCount : DatabaseCount;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_sourceServerName = If( json?.PropertyT("sourceServerName"), out var __jsonSourceServerName) ? (string)__jsonSourceServerName : (string)SourceServerName;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_targetServerName = If( json?.PropertyT("targetServerName"), out var __jsonTargetServerName) ? (string)__jsonTargetServerName : (string)TargetServerName;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_databaseErrorCount = If( json?.PropertyT("databaseErrorCount"), out var __jsonDatabaseErrorCount) ? (int?)__jsonDatabaseErrorCount : DatabaseErrorCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiSyncTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._databaseCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._databaseCount) : null, "databaseCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerName.ToString()) : null, "sourceServerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerName.ToString()) : null, "targetServerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._databaseErrorCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._databaseErrorCount) : null, "databaseErrorCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..9d0b7303368a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.PowerShell.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskPropertiesTypeConverter))] + public partial class MigrateSqlServerSqlMiSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiSyncTaskPropertiesTypeConverter))] + public partial interface IMigrateSqlServerSqlMiSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..d604652c1e7b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.cs new file mode 100644 index 000000000000..f50a68db488d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario + /// + public partial class MigrateSqlServerSqlMiSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Backing field for property. + private string _createdOn; + + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CreatedOn { get => this._createdOn; set => this._createdOn = value; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiSyncTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario + public partial interface IMigrateSqlServerSqlMiSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DateTime in UTC when the task was created", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(string) })] + string CreatedOn { get; set; } + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutputError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput[] Output { get; } + + } + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario + internal partial interface IMigrateSqlServerSqlMiSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// DateTime in UTC when the task was created + string CreatedOn { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.json.cs new file mode 100644 index 000000000000..a5950ac52ea7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiSyncTaskProperties.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario + /// + public partial class MigrateSqlServerSqlMiSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiSyncTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? (string)__jsonCreatedOn : (string)CreatedOn;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._createdOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdOn.ToString()) : null, "createdOn" ,container.Add ); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.PowerShell.cs new file mode 100644 index 000000000000..900bf3a6f4b9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.PowerShell.cs @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskInputTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("BackupBlobShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare) content.GetValueForProperty("BackupBlobShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShareTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).StartedOn = (string) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).StartedOn, global::System.Convert.ToString); + } + if (content.Contains("SelectedLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedLogin = (string[]) content.GetValueForProperty("SelectedLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedLogin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SelectedAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedAgentJob = (string[]) content.GetValueForProperty("SelectedAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedAgentJob, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BackupMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupMode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode?) content.GetValueForProperty("BackupMode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupMode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode.CreateFrom); + } + if (content.Contains("AadDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).AadDomainName = (string) content.GetValueForProperty("AadDomainName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).AadDomainName, global::System.Convert.ToString); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("BackupBlobShareSasUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri = (string) content.GetValueForProperty("BackupBlobShareSasUri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("BackupBlobShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare) content.GetValueForProperty("BackupBlobShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShareTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).StartedOn = (string) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).StartedOn, global::System.Convert.ToString); + } + if (content.Contains("SelectedLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedLogin = (string[]) content.GetValueForProperty("SelectedLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedLogin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SelectedAgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedAgentJob = (string[]) content.GetValueForProperty("SelectedAgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).SelectedAgentJob, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BackupMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupMode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode?) content.GetValueForProperty("BackupMode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupMode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode.CreateFrom); + } + if (content.Contains("AadDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).AadDomainName = (string) content.GetValueForProperty("AadDomainName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).AadDomainName, global::System.Convert.ToString); + } + if (content.Contains("EncryptedKeyForSecureField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).EncryptedKeyForSecureField = (string) content.GetValueForProperty("EncryptedKeyForSecureField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).EncryptedKeyForSecureField, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("BackupBlobShareSasUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri = (string) content.GetValueForProperty("BackupBlobShareSasUri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskInputTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..d65c0804fc0d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.cs new file mode 100644 index 000000000000..b8e6530cd34a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + /// + public partial class MigrateSqlServerSqlMiTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(); + + /// Backing field for property. + private string _aadDomainName; + + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AadDomainName { get => this._aadDomainName; set => this._aadDomainName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare _backupBlobShare; + + /// SAS URI of Azure Storage Account Container to be used for storing backup files. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare BackupBlobShare { get => (this._backupBlobShare = this._backupBlobShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare()); set => this._backupBlobShare = value; } + + /// SAS URI of Azure Storage Account Container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupBlobShareSasUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)BackupBlobShare).SasUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)BackupBlobShare).SasUri = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare _backupFileShare; + + /// Backup file share information for all selected databases. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set => this._backupFileShare = value; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? _backupMode; + + /// + /// Backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths + /// are required to be provided in selectedDatabases. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? BackupMode { get => this._backupMode; set => this._backupMode = value; } + + /// Backing field for property. + private string _encryptedKeyForSecureField; + + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EncryptedKeyForSecureField { get => this._encryptedKeyForSecureField; set => this._encryptedKeyForSecureField = value; } + + /// Internal Acessors for BackupBlobShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal.BackupBlobShare { get => (this._backupBlobShare = this._backupBlobShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare()); set { {_backupBlobShare = value;} } } + + /// Internal Acessors for BackupFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInputInternal.BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set { {_backupFileShare = value;} } } + + /// Backing field for property. + private string[] _selectedAgentJob; + + /// Agent Jobs to migrate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedAgentJob { get => this._selectedAgentJob; set => this._selectedAgentJob = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private string[] _selectedLogin; + + /// Logins to migrate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedLogin { get => this._selectedLogin; set => this._selectedLogin = value; } + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName = value ?? null; } + + /// Backing field for property. + private string _startedOn; + + /// Date and time relative to UTC when the migration was started on + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StartedOn { get => this._startedOn; set => this._startedOn = value; } + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName = value ?? null; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiTaskInput() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + await eventListener.AssertObjectIsValid(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + } + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + public partial interface IMigrateSqlServerSqlMiTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput + { + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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", + SerializedName = @"aadDomainName", + PossibleTypes = new [] { typeof(string) })] + string AadDomainName { get; set; } + /// SAS URI of Azure Storage Account Container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SAS URI of Azure Storage Account Container.", + SerializedName = @"sasUri", + PossibleTypes = new [] { typeof(string) })] + string BackupBlobShareSasUri { get; set; } + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string BackupFileShareUserName { get; set; } + /// + /// Backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths + /// are required to be provided in selectedDatabases. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths are required to be provided in selectedDatabases.", + SerializedName = @"backupMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? BackupMode { get; set; } + /// encrypted key for secure fields + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"encrypted key for secure fields", + SerializedName = @"encryptedKeyForSecureFields", + PossibleTypes = new [] { typeof(string) })] + string EncryptedKeyForSecureField { get; set; } + /// Agent Jobs to migrate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Agent Jobs to migrate.", + SerializedName = @"selectedAgentJobs", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedAgentJob { get; set; } + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get; set; } + /// Logins to migrate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logins to migrate.", + SerializedName = @"selectedLogins", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedLogin { get; set; } + /// Date and time relative to UTC when the migration was started on + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time relative to UTC when the migration was started on", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(string) })] + string StartedOn { get; set; } + + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + internal partial interface IMigrateSqlServerSqlMiTaskInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal + { + /// + /// 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 + /// + string AadDomainName { get; set; } + /// SAS URI of Azure Storage Account Container to be used for storing backup files. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare BackupBlobShare { get; set; } + /// SAS URI of Azure Storage Account Container. + string BackupBlobShareSasUri { get; set; } + /// Backup file share information for all selected databases. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get; set; } + /// Password credential used to connect to the share location. + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + string BackupFileShareUserName { get; set; } + /// + /// Backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths + /// are required to be provided in selectedDatabases. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? BackupMode { get; set; } + /// encrypted key for secure fields + string EncryptedKeyForSecureField { get; set; } + /// Agent Jobs to migrate. + string[] SelectedAgentJob { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get; set; } + /// Logins to migrate. + string[] SelectedLogin { get; set; } + /// Date and time relative to UTC when the migration was started on + string StartedOn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.json.cs new file mode 100644 index 000000000000..26970a2e3374 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskInput.json.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + /// + public partial class MigrateSqlServerSqlMiTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(json); + {_backupFileShare = If( json?.PropertyT("backupFileShare"), out var __jsonBackupFileShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare.FromJson(__jsonBackupFileShare) : BackupFileShare;} + {_backupBlobShare = If( json?.PropertyT("backupBlobShare"), out var __jsonBackupBlobShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare.FromJson(__jsonBackupBlobShare) : BackupBlobShare;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? (string)__jsonStartedOn : (string)StartedOn;} + {_selectedLogin = If( json?.PropertyT("selectedLogins"), out var __jsonSelectedLogins) ? If( __jsonSelectedLogins as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : SelectedLogin;} + {_selectedAgentJob = If( json?.PropertyT("selectedAgentJobs"), out var __jsonSelectedAgentJobs) ? If( __jsonSelectedAgentJobs as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : SelectedAgentJob;} + {_backupMode = If( json?.PropertyT("backupMode"), out var __jsonBackupMode) ? (string)__jsonBackupMode : (string)BackupMode;} + {_aadDomainName = If( json?.PropertyT("aadDomainName"), out var __jsonAadDomainName) ? (string)__jsonAadDomainName : (string)AadDomainName;} + {_encryptedKeyForSecureField = If( json?.PropertyT("encryptedKeyForSecureFields"), out var __jsonEncryptedKeyForSecureFields) ? (string)__jsonEncryptedKeyForSecureFields : (string)EncryptedKeyForSecureField;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __sqlMigrationTaskInput?.ToJson(container, serializationMode); + AddIf( null != this._backupFileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupFileShare.ToJson(null,serializationMode) : null, "backupFileShare" ,container.Add ); + AddIf( null != this._backupBlobShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupBlobShare.ToJson(null,serializationMode) : null, "backupBlobShare" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AddIf( null != (((object)this._startedOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn.ToString()) : null, "startedOn" ,container.Add ); + if (null != this._selectedLogin) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._selectedLogin ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("selectedLogins",__r); + } + if (null != this._selectedAgentJob) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __n in this._selectedAgentJob ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("selectedAgentJobs",__m); + } + AddIf( null != (((object)this._backupMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupMode.ToString()) : null, "backupMode" ,container.Add ); + AddIf( null != (((object)this._aadDomainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._aadDomainName.ToString()) : null, "aadDomainName" ,container.Add ); + AddIf( null != (((object)this._encryptedKeyForSecureField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._encryptedKeyForSecureField.ToString()) : null, "encryptedKeyForSecureFields" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..7f9bb8aa14de --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..83b105d3762e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.cs new file mode 100644 index 000000000000..5358fdab6e05 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + /// + public partial class MigrateSqlServerSqlMiTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiTaskOutput() + { + + } + } + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + public partial interface IMigrateSqlServerSqlMiTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + internal partial interface IMigrateSqlServerSqlMiTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.json.cs new file mode 100644 index 000000000000..a8660c4ae0ed --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutput.json.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. + /// + public partial class MigrateSqlServerSqlMiTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateSqlServerSqlMiTaskOutputMigrationLevel(json); + } + case "DatabaseLevelOutput": + { + return new MigrateSqlServerSqlMiTaskOutputDatabaseLevel(json); + } + case "AgentJobLevelOutput": + { + return new MigrateSqlServerSqlMiTaskOutputAgentJobLevel(json); + } + case "LoginLevelOutput": + { + return new MigrateSqlServerSqlMiTaskOutputLoginLevel(json); + } + case "ErrorOutput": + { + return new MigrateSqlServerSqlMiTaskOutputError(json); + } + } + return new MigrateSqlServerSqlMiTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.PowerShell.cs new file mode 100644 index 000000000000..e20c4b17cba9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputAgentJobLevelTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskOutputAgentJobLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskOutputAgentJobLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskOutputAgentJobLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskOutputAgentJobLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskOutputAgentJobLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputAgentJobLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskOutputAgentJobLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.TypeConverter.cs new file mode 100644 index 000000000000..b1b5a42c20a3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskOutputAgentJobLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskOutputAgentJobLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputAgentJobLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputAgentJobLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.cs new file mode 100644 index 000000000000..efeef2abc7e7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputAgentJobLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration errors and warnings per job + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; } + + /// Backing field for property. + private bool? _isEnabled; + + /// The state of the original Agent Job. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsEnabled { get => this._isEnabled; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for IsEnabled + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal.IsEnabled { get => this._isEnabled; set { {_isEnabled = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id = value; } + + /// Backing field for property. + private string _name; + + /// Agent Job name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType = value ; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlMiTaskOutputAgentJobLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiTaskOutputAgentJobLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration errors and warnings per job + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration errors and warnings per job", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// The state of the original Agent Job. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The state of the original Agent Job.", + SerializedName = @"isEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsEnabled { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Agent Job name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Agent Job name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + + } + internal partial interface IMigrateSqlServerSqlMiTaskOutputAgentJobLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Migration errors and warnings per job + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// The state of the original Agent Job. + bool? IsEnabled { get; set; } + /// Migration progress message + string Message { get; set; } + /// Agent Job name. + string Name { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.json.cs new file mode 100644 index 000000000000..7d42ea4d9706 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputAgentJobLevel.json.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputAgentJobLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiTaskOutputAgentJobLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskOutputAgentJobLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(json); + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isEnabled) : null, "isEnabled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.PowerShell.cs new file mode 100644 index 000000000000..fb288d17e452 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.PowerShell.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputDatabaseLevelTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskOutputDatabaseLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskOutputDatabaseLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskOutputDatabaseLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskOutputDatabaseLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskOutputDatabaseLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("SizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).SizeMb = (double?) content.GetValueForProperty("SizeMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).SizeMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputDatabaseLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskOutputDatabaseLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.TypeConverter.cs new file mode 100644 index 000000000000..e3137110ca69 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskOutputDatabaseLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskOutputDatabaseLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputDatabaseLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputDatabaseLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.cs new file mode 100644 index 000000000000..cc2aa33c8e9b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(); + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for DatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.DatabaseName { get => this._databaseName; set { {_databaseName = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for SizeMb + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.SizeMb { get => this._sizeMb; set { {_sizeMb = value;} } } + + /// Internal Acessors for Stage + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.Stage { get => this._stage; set { {_stage = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType = value ; } + + /// Backing field for property. + private double? _sizeMb; + + /// Size of the database in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? SizeMb { get => this._sizeMb; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? _stage; + + /// Current stage of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get => this._stage; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlMiTaskOutputDatabaseLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiTaskOutputDatabaseLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput + { + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration exceptions and warnings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Size of the database in megabytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Size of the database in megabytes", + SerializedName = @"sizeMB", + PossibleTypes = new [] { typeof(double) })] + double? SizeMb { get; } + /// Current stage of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current stage of migration", + SerializedName = @"stage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + + } + internal partial interface IMigrateSqlServerSqlMiTaskOutputDatabaseLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal + { + /// Name of the database + string DatabaseName { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Migration exceptions and warnings + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Migration progress message + string Message { get; set; } + /// Size of the database in megabytes + double? SizeMb { get; set; } + /// Current stage of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage? Stage { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.json.cs new file mode 100644 index 000000000000..ca8b99cf0e9a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputDatabaseLevel.json.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputDatabaseLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiTaskOutputDatabaseLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskOutputDatabaseLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(json); + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_sizeMb = If( json?.PropertyT("sizeMB"), out var __jsonSizeMb) ? (double?)__jsonSizeMb : SizeMb;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)Stage;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sizeMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._sizeMb) : null, "sizeMB" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._stage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stage.ToString()) : null, "stage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.PowerShell.cs new file mode 100644 index 000000000000..771dcc7a404a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputErrorTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskOutputError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskOutputError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskOutputError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskOutputError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskOutputError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputErrorTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskOutputError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.TypeConverter.cs new file mode 100644 index 000000000000..0be860f3f6fc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskOutputErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskOutputError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.cs new file mode 100644 index 000000000000..addbf286039e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(); + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ActionableMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).ActionableMessage = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException _error; + + /// Migration error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); } + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).FilePath = value ?? null; } + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? HResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).HResult = value ?? default(int); } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; } + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LineNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).LineNumber = value ?? null; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException()); set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id = value; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType = value ; } + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string StackTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)Error).StackTrace = value ?? null; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiTaskOutputError() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiTaskOutputError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + internal partial interface IMigrateSqlServerSqlMiTaskOutputErrorInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// Migration error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException Error { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.json.cs new file mode 100644 index 000000000000..89f1a88f9bf6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputError.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiTaskOutputError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskOutputError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.PowerShell.cs new file mode 100644 index 000000000000..1921b6bf8e3b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputLoginLevelTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskOutputLoginLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskOutputLoginLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskOutputLoginLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskOutputLoginLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LoginName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).LoginName = (string) content.GetValueForProperty("LoginName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).LoginName, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskOutputLoginLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LoginName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).LoginName = (string) content.GetValueForProperty("LoginName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).LoginName, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputLoginLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskOutputLoginLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.TypeConverter.cs new file mode 100644 index 000000000000..0f9955086458 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskOutputLoginLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskOutputLoginLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputLoginLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputLoginLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.cs new file mode 100644 index 000000000000..c6216880b132 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputLoginLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Login migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Login migration errors and warnings per login + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; } + + /// Backing field for property. + private string _loginName; + + /// Login name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LoginName { get => this._loginName; } + + /// Backing field for property. + private string _message; + + /// Login migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for LoginName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal.LoginName { get => this._loginName; set { {_loginName = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Stage + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal.Stage { get => this._stage; set { {_stage = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage? _stage; + + /// Current stage of login + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage? Stage { get => this._stage; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Login migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of login + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlMiTaskOutputLoginLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiTaskOutputLoginLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput + { + /// Login migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Login migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Login migration errors and warnings per login + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Login migration errors and warnings per login", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Login name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Login name.", + SerializedName = @"loginName", + PossibleTypes = new [] { typeof(string) })] + string LoginName { get; } + /// Login migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Login migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Current stage of login + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current stage of login", + SerializedName = @"stage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage? Stage { get; } + /// Login migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Login migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of login + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of login", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + + } + internal partial interface IMigrateSqlServerSqlMiTaskOutputLoginLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal + { + /// Login migration end time + global::System.DateTime? EndedOn { get; set; } + /// Login migration errors and warnings per login + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Login name. + string LoginName { get; set; } + /// Login migration progress message + string Message { get; set; } + /// Current stage of login + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage? Stage { get; set; } + /// Login migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of login + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.json.cs new file mode 100644 index 000000000000..fc3ed3bcb618 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputLoginLevel.json.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputLoginLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiTaskOutputLoginLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskOutputLoginLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(json); + {_loginName = If( json?.PropertyT("loginName"), out var __jsonLoginName) ? (string)__jsonLoginName : (string)LoginName;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)Stage;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._loginName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._loginName.ToString()) : null, "loginName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._stage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stage.ToString()) : null, "stage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..043f5fa76226 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("AgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).AgentJob = (string) content.GetValueForProperty("AgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).AgentJob, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ServerRoleResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ServerRoleResult = (string) content.GetValueForProperty("ServerRoleResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ServerRoleResult, global::System.Convert.ToString); + } + if (content.Contains("OrphanedUsersInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).OrphanedUsersInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo[]) content.GetValueForProperty("OrphanedUsersInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).OrphanedUsersInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OrphanedUserInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("AgentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).AgentJob = (string) content.GetValueForProperty("AgentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).AgentJob, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ServerRoleResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ServerRoleResult = (string) content.GetValueForProperty("ServerRoleResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ServerRoleResult, global::System.Convert.ToString); + } + if (content.Contains("OrphanedUsersInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).OrphanedUsersInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo[]) content.GetValueForProperty("OrphanedUsersInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).OrphanedUsersInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OrphanedUserInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Database = (string) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).Database, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..92f099fcca82 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..c8ef5bad531e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(); + + /// Backing field for property. + private string _agentJob; + + /// Selected agent jobs as a map from name to id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AgentJob { get => this._agentJob; } + + /// Backing field for property. + private string _database; + + /// Selected databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Database { get => this._database; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; } + + /// Backing field for property. + private string _login; + + /// Selected logins as a map from name to id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Login { get => this._login; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).Id = value; } + + /// Internal Acessors for AgentJob + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.AgentJob { get => this._agentJob; set { {_agentJob = value;} } } + + /// Internal Acessors for Database + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.Database { get => this._database; set { {_database = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for Login + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.Login { get => this._login; set { {_login = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for OrphanedUsersInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.OrphanedUsersInfo { get => this._orphanedUsersInfo; set { {_orphanedUsersInfo = value;} } } + + /// Internal Acessors for ServerRoleResult + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.ServerRoleResult { get => this._serverRoleResult; set { {_serverRoleResult = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo[] _orphanedUsersInfo; + + /// List of orphaned users. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo[] OrphanedUsersInfo { get => this._orphanedUsersInfo; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal)__migrateSqlServerSqlMiTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _serverRoleResult; + + /// Map of server role migration results. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerRoleResult { get => this._serverRoleResult; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? _status; + + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get => this._status; } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// + /// Creates an new instance. + /// + public MigrateSqlServerSqlMiTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSqlServerSqlMiTaskOutput), __migrateSqlServerSqlMiTaskOutput); + } + } + public partial interface IMigrateSqlServerSqlMiTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput + { + /// Selected agent jobs as a map from name to id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Selected agent jobs as a map from name to id", + SerializedName = @"agentJobs", + PossibleTypes = new [] { typeof(string) })] + string AgentJob { get; } + /// Selected databases as a map from database name to database id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Selected databases as a map from database name to database id", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(string) })] + string Database { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings.", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Selected logins as a map from name to id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Selected logins as a map from name to id", + SerializedName = @"logins", + PossibleTypes = new [] { typeof(string) })] + string Login { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// List of orphaned users. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of orphaned users.", + SerializedName = @"orphanedUsersInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo[] OrphanedUsersInfo { get; } + /// Map of server role migration results. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Map of server role migration results.", + SerializedName = @"serverRoleResults", + PossibleTypes = new [] { typeof(string) })] + string ServerRoleResult { get; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of migration", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateSqlServerSqlMiTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputInternal + { + /// Selected agent jobs as a map from name to id + string AgentJob { get; set; } + /// Selected databases as a map from database name to database id + string Database { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Migration exceptions and warnings. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Selected logins as a map from name to id + string Login { get; set; } + /// Migration progress message + string Message { get; set; } + /// List of orphaned users. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo[] OrphanedUsersInfo { get; set; } + /// Map of server role migration results. + string ServerRoleResult { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + /// Current status of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..abe342f35893 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskOutputMigrationLevel.json.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSqlServerSqlMiTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSqlServerSqlMiTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput(json); + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_agentJob = If( json?.PropertyT("agentJobs"), out var __jsonAgentJobs) ? (string)__jsonAgentJobs : (string)AgentJob;} + {_login = If( json?.PropertyT("logins"), out var __jsonLogins) ? (string)__jsonLogins : (string)Login;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_serverRoleResult = If( json?.PropertyT("serverRoleResults"), out var __jsonServerRoleResults) ? (string)__jsonServerRoleResults : (string)ServerRoleResult;} + {_orphanedUsersInfo = If( json?.PropertyT("orphanedUsersInfo"), out var __jsonOrphanedUsersInfo) ? If( __jsonOrphanedUsersInfo as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OrphanedUserInfo.FromJson(__u) )) ))() : null : OrphanedUsersInfo;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? (string)__jsonDatabases : (string)Database;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSqlServerSqlMiTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._agentJob)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._agentJob.ToString()) : null, "agentJobs" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._login)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._login.ToString()) : null, "logins" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serverRoleResult)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverRoleResult.ToString()) : null, "serverRoleResults" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._orphanedUsersInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._orphanedUsersInfo ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("orphanedUsersInfo",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._database)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._database.ToString()) : null, "databases" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._exceptionsAndWarning ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("exceptionsAndWarnings",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..3dfecfde330f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.PowerShell.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskPropertiesTypeConverter))] + public partial class MigrateSqlServerSqlMiTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSqlServerSqlMiTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSqlServerSqlMiTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSqlServerSqlMiTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("ParentTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).ParentTaskId = (string) content.GetValueForProperty("ParentTaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).ParentTaskId, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSqlServerSqlMiTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).CreatedOn = (string) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).CreatedOn, global::System.Convert.ToString); + } + if (content.Contains("ParentTaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).ParentTaskId = (string) content.GetValueForProperty("ParentTaskId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).ParentTaskId, global::System.Convert.ToString); + } + if (content.Contains("IsCloneable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).IsCloneable = (bool?) content.GetValueForProperty("IsCloneable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).IsCloneable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance + [System.ComponentModel.TypeConverter(typeof(MigrateSqlServerSqlMiTaskPropertiesTypeConverter))] + public partial interface IMigrateSqlServerSqlMiTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..c35e564775d8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSqlServerSqlMiTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSqlServerSqlMiTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSqlServerSqlMiTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.cs new file mode 100644 index 000000000000..e8519a55bd47 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance + /// + public partial class MigrateSqlServerSqlMiTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Backing field for property. + private string _createdOn; + + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CreatedOn { get => this._createdOn; set => this._createdOn = value; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskInput()); set => this._input = value; } + + /// Backing field for property. + private bool? _isCloneable; + + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsCloneable { get => this._isCloneable; set => this._isCloneable = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput[] Output { get => this._output; } + + /// Backing field for property. + private string _parentTaskId; + + /// parent task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ParentTaskId { get => this._parentTaskId; set => this._parentTaskId = value; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Backing field for property. + private string _taskId; + + /// task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public MigrateSqlServerSqlMiTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance + public partial interface IMigrateSqlServerSqlMiTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// DateTime in UTC when the task was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DateTime in UTC when the task was created", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(string) })] + string CreatedOn { get; set; } + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput Input { get; set; } + /// whether the task can be cloned or not + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether the task can be cloned or not", + SerializedName = @"isCloneable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputDatabaseLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputAgentJobLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputLoginLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutputError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput[] Output { get; } + /// parent task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"parent task id", + SerializedName = @"parentTaskId", + PossibleTypes = new [] { typeof(string) })] + string ParentTaskId { get; set; } + /// task id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"task id", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance + internal partial interface IMigrateSqlServerSqlMiTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// DateTime in UTC when the task was created + string CreatedOn { get; set; } + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskInput Input { get; set; } + /// whether the task can be cloned or not + bool? IsCloneable { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput[] Output { get; set; } + /// parent task id + string ParentTaskId { get; set; } + /// task id + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.json.cs new file mode 100644 index 000000000000..124332068938 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSqlServerSqlMiTaskProperties.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance + /// + public partial class MigrateSqlServerSqlMiTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSqlServerSqlMiTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSqlServerSqlMiTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? (string)__jsonCreatedOn : (string)CreatedOn;} + {_parentTaskId = If( json?.PropertyT("parentTaskId"), out var __jsonParentTaskId) ? (string)__jsonParentTaskId : (string)ParentTaskId;} + {_isCloneable = If( json?.PropertyT("isCloneable"), out var __jsonIsCloneable) ? (bool?)__jsonIsCloneable : IsCloneable;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != (((object)this._createdOn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdOn.ToString()) : null, "createdOn" ,container.Add ); + AddIf( null != (((object)this._parentTaskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._parentTaskId.ToString()) : null, "parentTaskId" ,container.Add ); + AddIf( null != this._isCloneable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isCloneable) : null, "isCloneable" ,container.Add ); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.PowerShell.cs new file mode 100644 index 000000000000..8fbc734f4194 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.PowerShell.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskInputTypeConverter))] + public partial class MigrateSsisTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSsisTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSsisTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSsisTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SsisMigrationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsisMigrationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo) content.GetValueForProperty("SsisMigrationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsisMigrationInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SsisMigrationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SsiMigrationInfoSsisStoreType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoSsisStoreType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType?) content.GetValueForProperty("SsiMigrationInfoSsisStoreType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoSsisStoreType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType.CreateFrom); + } + if (content.Contains("SsiMigrationInfoProjectOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoProjectOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("SsiMigrationInfoProjectOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoProjectOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + if (content.Contains("SsiMigrationInfoEnvironmentOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoEnvironmentOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("SsiMigrationInfoEnvironmentOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoEnvironmentOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSsisTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SsisMigrationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsisMigrationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo) content.GetValueForProperty("SsisMigrationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsisMigrationInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SsisMigrationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SsiMigrationInfoSsisStoreType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoSsisStoreType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType?) content.GetValueForProperty("SsiMigrationInfoSsisStoreType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoSsisStoreType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType.CreateFrom); + } + if (content.Contains("SsiMigrationInfoProjectOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoProjectOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("SsiMigrationInfoProjectOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoProjectOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + if (content.Contains("SsiMigrationInfoEnvironmentOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoEnvironmentOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("SsiMigrationInfoEnvironmentOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal)this).SsiMigrationInfoEnvironmentOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskInputTypeConverter))] + public partial interface IMigrateSsisTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..474a5062e10b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSsisTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSsisTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSsisTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSsisTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.cs new file mode 100644 index 000000000000..b273d64fb5c7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + /// + public partial class MigrateSsisTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(); + + /// Internal Acessors for SsisMigrationInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInputInternal.SsisMigrationInfo { get => (this._ssisMigrationInfo = this._ssisMigrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SsisMigrationInfo()); set { {_ssisMigrationInfo = value;} } } + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).SourceConnectionInfoUserName = value ?? null; } + + /// The overwrite option for the SSIS environment migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? SsiMigrationInfoEnvironmentOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)SsisMigrationInfo).EnvironmentOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)SsisMigrationInfo).EnvironmentOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption)""); } + + /// The overwrite option for the SSIS project migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? SsiMigrationInfoProjectOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)SsisMigrationInfo).ProjectOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)SsisMigrationInfo).ProjectOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption)""); } + + /// The SSIS store type of source, only SSIS catalog is supported now in DMS + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType? SsiMigrationInfoSsisStoreType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)SsisMigrationInfo).SsisStoreType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)SsisMigrationInfo).SsisStoreType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo _ssisMigrationInfo; + + /// SSIS package migration information. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo SsisMigrationInfo { get => (this._ssisMigrationInfo = this._ssisMigrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SsisMigrationInfo()); set => this._ssisMigrationInfo = value; } + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)__sqlMigrationTaskInput).TargetConnectionInfoUserName = value ?? null; } + + /// Creates an new instance. + public MigrateSsisTaskInput() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + await eventListener.AssertObjectIsValid(nameof(__sqlMigrationTaskInput), __sqlMigrationTaskInput); + } + } + /// Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + public partial interface IMigrateSsisTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput + { + /// The overwrite option for the SSIS environment migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The overwrite option for the SSIS environment migration", + SerializedName = @"environmentOverwriteOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? SsiMigrationInfoEnvironmentOverwriteOption { get; set; } + /// The overwrite option for the SSIS project migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The overwrite option for the SSIS project migration", + SerializedName = @"projectOverwriteOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? SsiMigrationInfoProjectOverwriteOption { get; set; } + /// The SSIS store type of source, only SSIS catalog is supported now in DMS + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SSIS store type of source, only SSIS catalog is supported now in DMS", + SerializedName = @"ssisStoreType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType? SsiMigrationInfoSsisStoreType { get; set; } + + } + /// Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + internal partial interface IMigrateSsisTaskInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal + { + /// The overwrite option for the SSIS environment migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? SsiMigrationInfoEnvironmentOverwriteOption { get; set; } + /// The overwrite option for the SSIS project migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? SsiMigrationInfoProjectOverwriteOption { get; set; } + /// The SSIS store type of source, only SSIS catalog is supported now in DMS + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType? SsiMigrationInfoSsisStoreType { get; set; } + /// SSIS package migration information. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo SsisMigrationInfo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.json.cs new file mode 100644 index 000000000000..6c9223b10d8f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskInput.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + /// + public partial class MigrateSsisTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSsisTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSsisTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __sqlMigrationTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationTaskInput(json); + {_ssisMigrationInfo = If( json?.PropertyT("ssisMigrationInfo"), out var __jsonSsisMigrationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SsisMigrationInfo.FromJson(__jsonSsisMigrationInfo) : SsisMigrationInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __sqlMigrationTaskInput?.ToJson(container, serializationMode); + AddIf( null != this._ssisMigrationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._ssisMigrationInfo.ToJson(null,serializationMode) : null, "ssisMigrationInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..9f61deb93e70 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskOutputTypeConverter))] + public partial class MigrateSsisTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSsisTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSsisTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSsisTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSsisTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskOutputTypeConverter))] + public partial interface IMigrateSsisTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..a032ae05497c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSsisTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSsisTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSsisTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSsisTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.cs new file mode 100644 index 000000000000..b485d85f2442 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + /// + public partial class MigrateSsisTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _resultType; + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Creates an new instance. + public MigrateSsisTaskOutput() + { + + } + } + /// Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + public partial interface IMigrateSsisTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result type", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + } + /// Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + internal partial interface IMigrateSsisTaskOutputInternal + + { + /// Result identifier + string Id { get; set; } + /// Result type + string ResultType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.json.cs new file mode 100644 index 000000000000..cd1c588a9e3f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutput.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + /// + public partial class MigrateSsisTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "MigrationLevelOutput": + { + return new MigrateSsisTaskOutputMigrationLevel(json); + } + case "SsisProjectLevelOutput": + { + return new MigrateSsisTaskOutputProjectLevel(json); + } + } + return new MigrateSsisTaskOutput(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSsisTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.PowerShell.cs new file mode 100644 index 000000000000..f0c99fd4500c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskOutputMigrationLevelTypeConverter))] + public partial class MigrateSsisTaskOutputMigrationLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSsisTaskOutputMigrationLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSsisTaskOutputMigrationLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSsisTaskOutputMigrationLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSsisTaskOutputMigrationLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskOutputMigrationLevelTypeConverter))] + public partial interface IMigrateSsisTaskOutputMigrationLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.TypeConverter.cs new file mode 100644 index 000000000000..96b9bb87238e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSsisTaskOutputMigrationLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSsisTaskOutputMigrationLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSsisTaskOutputMigrationLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSsisTaskOutputMigrationLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.cs new file mode 100644 index 000000000000..dbae81ab1466 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSsisTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput __migrateSsisTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).Id; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for SourceServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.SourceServerBrandVersion { get => this._sourceServerBrandVersion; set { {_sourceServerBrandVersion = value;} } } + + /// Internal Acessors for SourceServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.SourceServerVersion { get => this._sourceServerVersion; set { {_sourceServerVersion = value;} } } + + /// Internal Acessors for Stage + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.Stage { get => this._stage; set { {_stage = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TargetServerBrandVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.TargetServerBrandVersion { get => this._targetServerBrandVersion; set { {_targetServerBrandVersion = value;} } } + + /// Internal Acessors for TargetServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevelInternal.TargetServerVersion { get => this._targetServerVersion; set { {_targetServerVersion = value;} } } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).ResultType = value ; } + + /// Backing field for property. + private string _sourceServerBrandVersion; + + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerBrandVersion { get => this._sourceServerBrandVersion; } + + /// Backing field for property. + private string _sourceServerVersion; + + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerVersion { get => this._sourceServerVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? _stage; + + /// Stage of SSIS migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Stage { get => this._stage; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? _status; + + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get => this._status; } + + /// Backing field for property. + private string _targetServerBrandVersion; + + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerBrandVersion { get => this._targetServerBrandVersion; } + + /// Backing field for property. + private string _targetServerVersion; + + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerVersion { get => this._targetServerVersion; } + + /// Creates an new instance. + public MigrateSsisTaskOutputMigrationLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSsisTaskOutput), __migrateSsisTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSsisTaskOutput), __migrateSsisTaskOutput); + } + } + public partial interface IMigrateSsisTaskOutputMigrationLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings.", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Source server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server brand version", + SerializedName = @"sourceServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; } + /// Source server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source server version", + SerializedName = @"sourceServerVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; } + /// Stage of SSIS migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Stage of SSIS migration.", + SerializedName = @"stage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Stage { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current status of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of migration", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; } + /// Target server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server brand version", + SerializedName = @"targetServerBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; } + /// Target server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target server version", + SerializedName = @"targetServerVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; } + + } + internal partial interface IMigrateSsisTaskOutputMigrationLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Migration exceptions and warnings. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Migration progress message + string Message { get; set; } + /// Source server brand version + string SourceServerBrandVersion { get; set; } + /// Source server version + string SourceServerVersion { get; set; } + /// Stage of SSIS migration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Stage { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current status of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; set; } + /// Target server brand version + string TargetServerBrandVersion { get; set; } + /// Target server version + string TargetServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.json.cs new file mode 100644 index 000000000000..2d2642641976 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputMigrationLevel.json.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSsisTaskOutputMigrationLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSsisTaskOutputMigrationLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSsisTaskOutputMigrationLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSsisTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutput(json); + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_sourceServerVersion = If( json?.PropertyT("sourceServerVersion"), out var __jsonSourceServerVersion) ? (string)__jsonSourceServerVersion : (string)SourceServerVersion;} + {_sourceServerBrandVersion = If( json?.PropertyT("sourceServerBrandVersion"), out var __jsonSourceServerBrandVersion) ? (string)__jsonSourceServerBrandVersion : (string)SourceServerBrandVersion;} + {_targetServerVersion = If( json?.PropertyT("targetServerVersion"), out var __jsonTargetServerVersion) ? (string)__jsonTargetServerVersion : (string)TargetServerVersion;} + {_targetServerBrandVersion = If( json?.PropertyT("targetServerBrandVersion"), out var __jsonTargetServerBrandVersion) ? (string)__jsonTargetServerBrandVersion : (string)TargetServerBrandVersion;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)Stage;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSsisTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerVersion.ToString()) : null, "sourceServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerBrandVersion.ToString()) : null, "sourceServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerVersion.ToString()) : null, "targetServerVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerBrandVersion.ToString()) : null, "targetServerBrandVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._stage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stage.ToString()) : null, "stage" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.PowerShell.cs new file mode 100644 index 000000000000..d90d0b4036b2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.PowerShell.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskOutputProjectLevelTypeConverter))] + public partial class MigrateSsisTaskOutputProjectLevel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSsisTaskOutputProjectLevel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSsisTaskOutputProjectLevel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSsisTaskOutputProjectLevel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FolderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).FolderName = (string) content.GetValueForProperty("FolderName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).FolderName, global::System.Convert.ToString); + } + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSsisTaskOutputProjectLevel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FolderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).FolderName = (string) content.GetValueForProperty("FolderName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).FolderName, global::System.Convert.ToString); + } + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage?) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Stage, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage.CreateFrom); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)this).ResultType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskOutputProjectLevelTypeConverter))] + public partial interface IMigrateSsisTaskOutputProjectLevel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.TypeConverter.cs new file mode 100644 index 000000000000..a15cbc8a80aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSsisTaskOutputProjectLevelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSsisTaskOutputProjectLevel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSsisTaskOutputProjectLevel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSsisTaskOutputProjectLevel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.cs new file mode 100644 index 000000000000..25a7e3e0d88b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSsisTaskOutputProjectLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput __migrateSsisTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutput(); + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Backing field for property. + private string _folderName; + + /// Name of the folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FolderName { get => this._folderName; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).Id; } + + /// Backing field for property. + private string _message; + + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).Id = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for FolderName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.FolderName { get => this._folderName; set { {_folderName = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for ProjectName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.ProjectName { get => this._projectName; set { {_projectName = value;} } } + + /// Internal Acessors for Stage + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.Stage { get => this._stage; set { {_stage = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevelInternal.State { get => this._state; set { {_state = value;} } } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProjectName { get => this._projectName; } + + /// Result type + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal)__migrateSsisTaskOutput).ResultType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? _stage; + + /// Stage of SSIS migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Stage { get => this._stage; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Creates an new instance. + public MigrateSsisTaskOutputProjectLevel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__migrateSsisTaskOutput), __migrateSsisTaskOutput); + await eventListener.AssertObjectIsValid(nameof(__migrateSsisTaskOutput), __migrateSsisTaskOutput); + } + } + public partial interface IMigrateSsisTaskOutputProjectLevel : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput + { + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration exceptions and warnings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Name of the folder + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the folder", + SerializedName = @"folderName", + PossibleTypes = new [] { typeof(string) })] + string FolderName { get; } + /// Migration progress message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration progress message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Name of the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + string ProjectName { get; } + /// Stage of SSIS migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Stage of SSIS migration.", + SerializedName = @"stage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Stage { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + + } + internal partial interface IMigrateSsisTaskOutputProjectLevelInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputInternal + { + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Migration exceptions and warnings + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Name of the folder + string FolderName { get; set; } + /// Migration progress message + string Message { get; set; } + /// Name of the project + string ProjectName { get; set; } + /// Stage of SSIS migration. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage? Stage { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.json.cs new file mode 100644 index 000000000000..cd825dbcff4f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskOutputProjectLevel.json.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrateSsisTaskOutputProjectLevel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSsisTaskOutputProjectLevel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSsisTaskOutputProjectLevel(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __migrateSsisTaskOutput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutput(json); + {_folderName = If( json?.PropertyT("folderName"), out var __jsonFolderName) ? (string)__jsonFolderName : (string)FolderName;} + {_projectName = If( json?.PropertyT("projectName"), out var __jsonProjectName) ? (string)__jsonProjectName : (string)ProjectName;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)Stage;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __migrateSsisTaskOutput?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._folderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._folderName.ToString()) : null, "folderName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._projectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._projectName.ToString()) : null, "projectName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._stage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stage.ToString()) : null, "stage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..63f6e5d2ab52 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.PowerShell.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. + /// + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskPropertiesTypeConverter))] + public partial class MigrateSsisTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSsisTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSsisTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSsisTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSsisTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. + [System.ComponentModel.TypeConverter(typeof(MigrateSsisTaskPropertiesTypeConverter))] + public partial interface IMigrateSsisTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..11d5a474719f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSsisTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSsisTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSsisTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSsisTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.cs new file mode 100644 index 000000000000..d48f3eae4e27 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. + /// + public partial class MigrateSsisTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskInput()); set => this._input = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public MigrateSsisTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. + public partial interface IMigrateSsisTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputMigrationLevel),typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutputProjectLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput[] Output { get; } + + } + /// Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. + internal partial interface IMigrateSsisTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.json.cs new file mode 100644 index 000000000000..31dfe4ee9d30 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSsisTaskProperties.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. + /// + public partial class MigrateSsisTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSsisTaskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSsisTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSsisTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSsisTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.PowerShell.cs new file mode 100644 index 000000000000..54918fa6ecd2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for command that completes sync migration for a database. + [System.ComponentModel.TypeConverter(typeof(MigrateSyncCompleteCommandInputTypeConverter))] + public partial class MigrateSyncCompleteCommandInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSyncCompleteCommandInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSyncCompleteCommandInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSyncCompleteCommandInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CommitTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).CommitTimeStamp = (global::System.DateTime?) content.GetValueForProperty("CommitTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).CommitTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSyncCompleteCommandInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("CommitTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).CommitTimeStamp = (global::System.DateTime?) content.GetValueForProperty("CommitTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)this).CommitTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for command that completes sync migration for a database. + [System.ComponentModel.TypeConverter(typeof(MigrateSyncCompleteCommandInputTypeConverter))] + public partial interface IMigrateSyncCompleteCommandInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.TypeConverter.cs new file mode 100644 index 000000000000..491f65b3ef1d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSyncCompleteCommandInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSyncCompleteCommandInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSyncCompleteCommandInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSyncCompleteCommandInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.cs new file mode 100644 index 000000000000..fcee324b9bd9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for command that completes sync migration for a database. + public partial class MigrateSyncCompleteCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal + { + + /// Backing field for property. + private global::System.DateTime? _commitTimeStamp; + + /// Time stamp to complete + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? CommitTimeStamp { get => this._commitTimeStamp; set => this._commitTimeStamp = value; } + + /// Backing field for property. + private string _databaseName; + + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// Creates an new instance. + public MigrateSyncCompleteCommandInput() + { + + } + } + /// Input for command that completes sync migration for a database. + public partial interface IMigrateSyncCompleteCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Time stamp to complete + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time stamp to complete", + SerializedName = @"commitTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CommitTimeStamp { get; set; } + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + + } + /// Input for command that completes sync migration for a database. + internal partial interface IMigrateSyncCompleteCommandInputInternal + + { + /// Time stamp to complete + global::System.DateTime? CommitTimeStamp { get; set; } + /// Name of database + string DatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.json.cs new file mode 100644 index 000000000000..fed5bc18b6f4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandInput.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for command that completes sync migration for a database. + public partial class MigrateSyncCompleteCommandInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSyncCompleteCommandInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSyncCompleteCommandInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_commitTimeStamp = If( json?.PropertyT("commitTimeStamp"), out var __jsonCommitTimeStamp) ? global::System.DateTime.TryParse((string)__jsonCommitTimeStamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCommitTimeStampValue) ? __jsonCommitTimeStampValue : CommitTimeStamp : CommitTimeStamp;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AddIf( null != this._commitTimeStamp ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._commitTimeStamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "commitTimeStamp" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.PowerShell.cs new file mode 100644 index 000000000000..3970d0c8c82c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output for command that completes sync migration for a database. + [System.ComponentModel.TypeConverter(typeof(MigrateSyncCompleteCommandOutputTypeConverter))] + public partial class MigrateSyncCompleteCommandOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSyncCompleteCommandOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSyncCompleteCommandOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSyncCompleteCommandOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSyncCompleteCommandOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Output for command that completes sync migration for a database. + [System.ComponentModel.TypeConverter(typeof(MigrateSyncCompleteCommandOutputTypeConverter))] + public partial interface IMigrateSyncCompleteCommandOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.TypeConverter.cs new file mode 100644 index 000000000000..560ab733a484 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSyncCompleteCommandOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSyncCompleteCommandOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSyncCompleteCommandOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSyncCompleteCommandOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.cs new file mode 100644 index 000000000000..ee4082a9f1f3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for command that completes sync migration for a database. + public partial class MigrateSyncCompleteCommandOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _error; + + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Error { get => this._error; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal.Error { get => this._error; set { {_error = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Creates an new instance. + public MigrateSyncCompleteCommandOutput() + { + + } + } + /// Output for command that completes sync migration for a database. + public partial interface IMigrateSyncCompleteCommandOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of errors that happened during the command execution", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Error { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + + } + /// Output for command that completes sync migration for a database. + internal partial interface IMigrateSyncCompleteCommandOutputInternal + + { + /// List of errors that happened during the command execution + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Error { get; set; } + /// Result identifier + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.json.cs new file mode 100644 index 000000000000..9df85c76fed6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandOutput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for command that completes sync migration for a database. + public partial class MigrateSyncCompleteCommandOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSyncCompleteCommandOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSyncCompleteCommandOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? If( __jsonErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._error) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._error ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("errors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.PowerShell.cs new file mode 100644 index 000000000000..bade85451d89 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.PowerShell.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the command that completes sync migration for a database. + [System.ComponentModel.TypeConverter(typeof(MigrateSyncCompleteCommandPropertiesTypeConverter))] + public partial class MigrateSyncCompleteCommandProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrateSyncCompleteCommandProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrateSyncCompleteCommandProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrateSyncCompleteCommandProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Output, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandOutputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).CommandId = (string) content.GetValueForProperty("CommandId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).CommandId, global::System.Convert.ToString); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputDatabaseName = (string) content.GetValueForProperty("InputDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("InputCommitTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputCommitTimeStamp = (global::System.DateTime?) content.GetValueForProperty("InputCommitTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputCommitTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OutputId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputId = (string) content.GetValueForProperty("OutputId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputId, global::System.Convert.ToString); + } + if (content.Contains("OutputError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("OutputError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrateSyncCompleteCommandProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).Output, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandOutputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).CommandId = (string) content.GetValueForProperty("CommandId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).CommandId, global::System.Convert.ToString); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputDatabaseName = (string) content.GetValueForProperty("InputDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("InputCommitTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputCommitTimeStamp = (global::System.DateTime?) content.GetValueForProperty("InputCommitTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).InputCommitTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OutputId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputId = (string) content.GetValueForProperty("OutputId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputId, global::System.Convert.ToString); + } + if (content.Contains("OutputError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("OutputError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal)this).OutputError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the command that completes sync migration for a database. + [System.ComponentModel.TypeConverter(typeof(MigrateSyncCompleteCommandPropertiesTypeConverter))] + public partial interface IMigrateSyncCompleteCommandProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.TypeConverter.cs new file mode 100644 index 000000000000..68df0fcfc5d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrateSyncCompleteCommandPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrateSyncCompleteCommandProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrateSyncCompleteCommandProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrateSyncCompleteCommandProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.cs new file mode 100644 index 000000000000..19ecbb4af5ff --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that completes sync migration for a database. + public partial class MigrateSyncCompleteCommandProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(); + + /// Backing field for property. + private string _commandId; + + /// Command id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CommandId { get => this._commandId; set => this._commandId = value; } + + /// Command type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType = value ; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput _input; + + /// Command input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandInput()); set => this._input = value; } + + /// Time stamp to complete + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? InputCommitTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)Input).CommitTimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)Input).CommitTimeStamp = value ?? default(global::System.DateTime); } + + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)Input).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInputInternal)Input).DatabaseName = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandInput()); set { {_input = value;} } } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal.Output { get => (this._output = this._output ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandOutput()); set { {_output = value;} } } + + /// Internal Acessors for OutputError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal.OutputError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)Output).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)Output).Error = value; } + + /// Internal Acessors for OutputId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandPropertiesInternal.OutputId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)Output).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)Output).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput _output; + + /// Command output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput Output { get => (this._output = this._output ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandOutput()); } + + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] OutputError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)Output).Error; } + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string OutputId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutputInternal)Output).Id; } + + /// The state of the command. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; } + + /// Creates an new instance. + public MigrateSyncCompleteCommandProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__commandProperties), __commandProperties); + await eventListener.AssertObjectIsValid(nameof(__commandProperties), __commandProperties); + } + } + /// Properties for the command that completes sync migration for a database. + public partial interface IMigrateSyncCompleteCommandProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + { + /// Command id + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Command id", + SerializedName = @"commandId", + PossibleTypes = new [] { typeof(string) })] + string CommandId { get; set; } + /// Time stamp to complete + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time stamp to complete", + SerializedName = @"commitTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InputCommitTimeStamp { get; set; } + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string InputDatabaseName { get; set; } + /// List of errors that happened during the command execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of errors that happened during the command execution", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] OutputError { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string OutputId { get; } + + } + /// Properties for the command that completes sync migration for a database. + internal partial interface IMigrateSyncCompleteCommandPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal + { + /// Command id + string CommandId { get; set; } + /// Command input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandInput Input { get; set; } + /// Time stamp to complete + global::System.DateTime? InputCommitTimeStamp { get; set; } + /// Name of database + string InputDatabaseName { get; set; } + /// Command output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandOutput Output { get; set; } + /// List of errors that happened during the command execution + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] OutputError { get; set; } + /// Result identifier + string OutputId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.json.cs new file mode 100644 index 000000000000..2416d1e80004 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrateSyncCompleteCommandProperties.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that completes sync migration for a database. + public partial class MigrateSyncCompleteCommandProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSyncCompleteCommandProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrateSyncCompleteCommandProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateSyncCompleteCommandProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSyncCompleteCommandOutput.FromJson(__jsonOutput) : Output;} + {_commandId = If( json?.PropertyT("commandId"), out var __jsonCommandId) ? (string)__jsonCommandId : (string)CommandId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __commandProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._output ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._output.ToJson(null,serializationMode) : null, "output" ,container.Add ); + } + AddIf( null != (((object)this._commandId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._commandId.ToString()) : null, "commandId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.PowerShell.cs new file mode 100644 index 000000000000..cf5aff41b8fa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information about migration eligibility of a server object + [System.ComponentModel.TypeConverter(typeof(MigrationEligibilityInfoTypeConverter))] + public partial class MigrationEligibilityInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationEligibilityInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationEligibilityInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationEligibilityInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsEligibleForMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).IsEligibleForMigration = (bool?) content.GetValueForProperty("IsEligibleForMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).IsEligibleForMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).ValidationMessage = (string[]) content.GetValueForProperty("ValidationMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).ValidationMessage, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationEligibilityInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsEligibleForMigration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).IsEligibleForMigration = (bool?) content.GetValueForProperty("IsEligibleForMigration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).IsEligibleForMigration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).ValidationMessage = (string[]) content.GetValueForProperty("ValidationMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal)this).ValidationMessage, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about migration eligibility of a server object + [System.ComponentModel.TypeConverter(typeof(MigrationEligibilityInfoTypeConverter))] + public partial interface IMigrationEligibilityInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.TypeConverter.cs new file mode 100644 index 000000000000..ede5d4f0cc2a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationEligibilityInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationEligibilityInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationEligibilityInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationEligibilityInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.cs new file mode 100644 index 000000000000..852f9df2ea40 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about migration eligibility of a server object + public partial class MigrationEligibilityInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal + { + + /// Backing field for property. + private bool? _isEligibleForMigration; + + /// Whether object is eligible for migration or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsEligibleForMigration { get => this._isEligibleForMigration; } + + /// Internal Acessors for IsEligibleForMigration + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal.IsEligibleForMigration { get => this._isEligibleForMigration; set { {_isEligibleForMigration = value;} } } + + /// Internal Acessors for ValidationMessage + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfoInternal.ValidationMessage { get => this._validationMessage; set { {_validationMessage = value;} } } + + /// Backing field for property. + private string[] _validationMessage; + + /// Information about eligibility failure for the server object. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] ValidationMessage { get => this._validationMessage; } + + /// Creates an new instance. + public MigrationEligibilityInfo() + { + + } + } + /// Information about migration eligibility of a server object + public partial interface IMigrationEligibilityInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Whether object is eligible for migration or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether object is eligible for migration or not.", + SerializedName = @"isEligibleForMigration", + PossibleTypes = new [] { typeof(bool) })] + bool? IsEligibleForMigration { get; } + /// Information about eligibility failure for the server object. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Information about eligibility failure for the server object.", + SerializedName = @"validationMessages", + PossibleTypes = new [] { typeof(string) })] + string[] ValidationMessage { get; } + + } + /// Information about migration eligibility of a server object + internal partial interface IMigrationEligibilityInfoInternal + + { + /// Whether object is eligible for migration or not. + bool? IsEligibleForMigration { get; set; } + /// Information about eligibility failure for the server object. + string[] ValidationMessage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.json.cs new file mode 100644 index 000000000000..e38c814de8b5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationEligibilityInfo.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about migration eligibility of a server object + public partial class MigrationEligibilityInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationEligibilityInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationEligibilityInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationEligibilityInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_isEligibleForMigration = If( json?.PropertyT("isEligibleForMigration"), out var __jsonIsEligibleForMigration) ? (bool?)__jsonIsEligibleForMigration : IsEligibleForMigration;} + {_validationMessage = If( json?.PropertyT("validationMessages"), out var __jsonValidationMessages) ? If( __jsonValidationMessages as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ValidationMessage;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isEligibleForMigration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isEligibleForMigration) : null, "isEligibleForMigration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationMessage) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationMessage ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("validationMessages",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.PowerShell.cs new file mode 100644 index 000000000000..dab2615351b1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration Operation Input + [System.ComponentModel.TypeConverter(typeof(MigrationOperationInputTypeConverter))] + public partial class MigrationOperationInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationOperationInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationOperationInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationOperationInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInputInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInputInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationOperationInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationOperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInputInternal)this).MigrationOperationId = (string) content.GetValueForProperty("MigrationOperationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInputInternal)this).MigrationOperationId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration Operation Input + [System.ComponentModel.TypeConverter(typeof(MigrationOperationInputTypeConverter))] + public partial interface IMigrationOperationInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.TypeConverter.cs new file mode 100644 index 000000000000..904b9df4711e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationOperationInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationOperationInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationOperationInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationOperationInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.cs new file mode 100644 index 000000000000..fa041a0fcab0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Operation Input + public partial class MigrationOperationInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInputInternal + { + + /// Backing field for property. + private string _migrationOperationId; + + /// ID tracking migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// Creates an new instance. + public MigrationOperationInput() + { + + } + } + /// Migration Operation Input + public partial interface IMigrationOperationInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// ID tracking migration operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationOperationId { get; set; } + + } + /// Migration Operation Input + internal partial interface IMigrationOperationInputInternal + + { + /// ID tracking migration operation. + string MigrationOperationId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.json.cs new file mode 100644 index 000000000000..92d200f80da9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationOperationInput.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Operation Input + public partial class MigrationOperationInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationOperationInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationOperationInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_migrationOperationId = If( json?.PropertyT("migrationOperationId"), out var __jsonMigrationOperationId) ? (string)__jsonMigrationOperationId : (string)MigrationOperationId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._migrationOperationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationOperationId.ToString()) : null, "migrationOperationId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.PowerShell.cs new file mode 100644 index 000000000000..8f1dfbc2cc92 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Migration validation report result, contains the url for downloading the generated report. + /// + [System.ComponentModel.TypeConverter(typeof(MigrationReportResultTypeConverter))] + public partial class MigrationReportResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationReportResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationReportResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationReportResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).ReportUrl = (string) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).ReportUrl, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationReportResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).ReportUrl = (string) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal)this).ReportUrl, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration validation report result, contains the url for downloading the generated report. + [System.ComponentModel.TypeConverter(typeof(MigrationReportResultTypeConverter))] + public partial interface IMigrationReportResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.TypeConverter.cs new file mode 100644 index 000000000000..bc91e38fa7a4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationReportResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationReportResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationReportResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationReportResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.cs new file mode 100644 index 000000000000..e5e191bd3078 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Migration validation report result, contains the url for downloading the generated report. + /// + public partial class MigrationReportResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResultInternal + { + + /// Backing field for property. + private string _id; + + /// Migration validation result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _reportUrl; + + /// The url of the report. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ReportUrl { get => this._reportUrl; set => this._reportUrl = value; } + + /// Creates an new instance. + public MigrationReportResult() + { + + } + } + /// Migration validation report result, contains the url for downloading the generated report. + public partial interface IMigrationReportResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Migration validation result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Migration validation result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The url of the report. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url of the report.", + SerializedName = @"reportUrl", + PossibleTypes = new [] { typeof(string) })] + string ReportUrl { get; set; } + + } + /// Migration validation report result, contains the url for downloading the generated report. + internal partial interface IMigrationReportResultInternal + + { + /// Migration validation result identifier + string Id { get; set; } + /// The url of the report. + string ReportUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.json.cs new file mode 100644 index 000000000000..6ba89f99d7ed --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationReportResult.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Migration validation report result, contains the url for downloading the generated report. + /// + public partial class MigrationReportResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationReportResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationReportResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationReportResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_reportUrl = If( json?.PropertyT("reportUrl"), out var __jsonReportUrl) ? (string)__jsonReportUrl : (string)ReportUrl;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._reportUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._reportUrl.ToString()) : null, "reportUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.PowerShell.cs new file mode 100644 index 000000000000..8e5c12a0c957 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.PowerShell.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Detailed status of current migration. + [System.ComponentModel.TypeConverter(typeof(MigrationStatusDetailsTypeConverter))] + public partial class MigrationStatusDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationStatusDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationStatusDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationStatusDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FullBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo) content.GetValueForProperty("FullBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("LastRestoredBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo) content.GetValueForProperty("LastRestoredBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).MigrationState = (string) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).MigrationState, global::System.Convert.ToString); + } + if (content.Contains("ActiveBackupSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).ActiveBackupSet = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo[]) content.GetValueForProperty("ActiveBackupSet",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).ActiveBackupSet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("InvalidFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).InvalidFile = (string[]) content.GetValueForProperty("InvalidFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).InvalidFile, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).BlobContainerName, global::System.Convert.ToString); + } + if (content.Contains("IsFullBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).IsFullBackupRestored = (bool?) content.GetValueForProperty("IsFullBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).IsFullBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestoreBlockingReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).RestoreBlockingReason = (string) content.GetValueForProperty("RestoreBlockingReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).RestoreBlockingReason, global::System.Convert.ToString); + } + if (content.Contains("CompleteRestoreErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CompleteRestoreErrorMessage = (string) content.GetValueForProperty("CompleteRestoreErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CompleteRestoreErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("FileUploadBlockingError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FileUploadBlockingError = (string[]) content.GetValueForProperty("FileUploadBlockingError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FileUploadBlockingError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CurrentRestoringFilename")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CurrentRestoringFilename = (string) content.GetValueForProperty("CurrentRestoringFilename",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CurrentRestoringFilename, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredFilename")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredFilename = (string) content.GetValueForProperty("LastRestoredFilename",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredFilename, global::System.Convert.ToString); + } + if (content.Contains("PendingLogBackupsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).PendingLogBackupsCount = (int?) content.GetValueForProperty("PendingLogBackupsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).PendingLogBackupsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FullBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupSetId = (string) content.GetValueForProperty("FullBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFirstLsn = (string) content.GetValueForProperty("FullBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoLastLsn = (string) content.GetValueForProperty("FullBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupType = (string) content.GetValueForProperty("FullBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupType, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[]) content.GetValueForProperty("FullBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("FullBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoBackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("FullBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FullBackupSetInfoHasBackupChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoHasBackupChecksum = (bool?) content.GetValueForProperty("FullBackupSetInfoHasBackupChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoHasBackupChecksum, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FullBackupSetInfoFamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFamilyCount = (int?) content.GetValueForProperty("FullBackupSetInfoFamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FullBackupSetInfoIgnoreReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIgnoreReason = (string[]) content.GetValueForProperty("FullBackupSetInfoIgnoreReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIgnoreReason, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupSetId = (string) content.GetValueForProperty("LastRestoredBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFirstLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoLastLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupType = (string) content.GetValueForProperty("LastRestoredBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupType, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[]) content.GetValueForProperty("LastRestoredBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("LastRestoredBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastRestoredBackupSetInfoHasBackupChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoHasBackupChecksum = (bool?) content.GetValueForProperty("LastRestoredBackupSetInfoHasBackupChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoHasBackupChecksum, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastRestoredBackupSetInfoFamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFamilyCount = (int?) content.GetValueForProperty("LastRestoredBackupSetInfoFamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastRestoredBackupSetInfoIgnoreReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIgnoreReason = (string[]) content.GetValueForProperty("LastRestoredBackupSetInfoIgnoreReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIgnoreReason, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationStatusDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FullBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo) content.GetValueForProperty("FullBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("LastRestoredBackupSetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo) content.GetValueForProperty("LastRestoredBackupSetInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfoTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).MigrationState = (string) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).MigrationState, global::System.Convert.ToString); + } + if (content.Contains("ActiveBackupSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).ActiveBackupSet = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo[]) content.GetValueForProperty("ActiveBackupSet",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).ActiveBackupSet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("InvalidFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).InvalidFile = (string[]) content.GetValueForProperty("InvalidFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).InvalidFile, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).BlobContainerName, global::System.Convert.ToString); + } + if (content.Contains("IsFullBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).IsFullBackupRestored = (bool?) content.GetValueForProperty("IsFullBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).IsFullBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestoreBlockingReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).RestoreBlockingReason = (string) content.GetValueForProperty("RestoreBlockingReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).RestoreBlockingReason, global::System.Convert.ToString); + } + if (content.Contains("CompleteRestoreErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CompleteRestoreErrorMessage = (string) content.GetValueForProperty("CompleteRestoreErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CompleteRestoreErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("FileUploadBlockingError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FileUploadBlockingError = (string[]) content.GetValueForProperty("FileUploadBlockingError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FileUploadBlockingError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CurrentRestoringFilename")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CurrentRestoringFilename = (string) content.GetValueForProperty("CurrentRestoringFilename",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).CurrentRestoringFilename, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredFilename")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredFilename = (string) content.GetValueForProperty("LastRestoredFilename",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredFilename, global::System.Convert.ToString); + } + if (content.Contains("PendingLogBackupsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).PendingLogBackupsCount = (int?) content.GetValueForProperty("PendingLogBackupsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).PendingLogBackupsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FullBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupSetId = (string) content.GetValueForProperty("FullBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFirstLsn = (string) content.GetValueForProperty("FullBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoLastLsn = (string) content.GetValueForProperty("FullBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupType = (string) content.GetValueForProperty("FullBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupType, global::System.Convert.ToString); + } + if (content.Contains("FullBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[]) content.GetValueForProperty("FullBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("FullBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoBackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("FullBackupSetInfoBackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoBackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FullBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("FullBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FullBackupSetInfoHasBackupChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoHasBackupChecksum = (bool?) content.GetValueForProperty("FullBackupSetInfoHasBackupChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoHasBackupChecksum, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FullBackupSetInfoFamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFamilyCount = (int?) content.GetValueForProperty("FullBackupSetInfoFamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoFamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FullBackupSetInfoIgnoreReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIgnoreReason = (string[]) content.GetValueForProperty("FullBackupSetInfoIgnoreReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).FullBackupSetInfoIgnoreReason, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupSetId = (string) content.GetValueForProperty("LastRestoredBackupSetInfoBackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupSetId, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoFirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFirstLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoFirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoLastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoLastLsn = (string) content.GetValueForProperty("LastRestoredBackupSetInfoLastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoLastLsn, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupType = (string) content.GetValueForProperty("LastRestoredBackupSetInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupType, global::System.Convert.ToString); + } + if (content.Contains("LastRestoredBackupSetInfoListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[]) content.GetValueForProperty("LastRestoredBackupSetInfoListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupStartDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoBackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("LastRestoredBackupSetInfoBackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoBackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastRestoredBackupSetInfoIsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIsBackupRestored = (bool?) content.GetValueForProperty("LastRestoredBackupSetInfoIsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastRestoredBackupSetInfoHasBackupChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoHasBackupChecksum = (bool?) content.GetValueForProperty("LastRestoredBackupSetInfoHasBackupChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoHasBackupChecksum, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastRestoredBackupSetInfoFamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFamilyCount = (int?) content.GetValueForProperty("LastRestoredBackupSetInfoFamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoFamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastRestoredBackupSetInfoIgnoreReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIgnoreReason = (string[]) content.GetValueForProperty("LastRestoredBackupSetInfoIgnoreReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal)this).LastRestoredBackupSetInfoIgnoreReason, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Detailed status of current migration. + [System.ComponentModel.TypeConverter(typeof(MigrationStatusDetailsTypeConverter))] + public partial interface IMigrationStatusDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.TypeConverter.cs new file mode 100644 index 000000000000..5c2d543f003e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationStatusDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationStatusDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationStatusDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationStatusDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.cs new file mode 100644 index 000000000000..d2ab1780955c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.cs @@ -0,0 +1,652 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Detailed status of current migration. + public partial class MigrationStatusDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo[] _activeBackupSet; + + /// Backup sets that are currently active. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo[] ActiveBackupSet { get => this._activeBackupSet; } + + /// Backing field for property. + private string _blobContainerName; + + /// Name of blob container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string BlobContainerName { get => this._blobContainerName; } + + /// Backing field for property. + private string _completeRestoreErrorMessage; + + /// Complete restore error message, if any + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CompleteRestoreErrorMessage { get => this._completeRestoreErrorMessage; } + + /// Backing field for property. + private string _currentRestoringFilename; + + /// File name that is currently being restored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CurrentRestoringFilename { get => this._currentRestoringFilename; } + + /// Backing field for property. + private string[] _fileUploadBlockingError; + + /// File upload blocking errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] FileUploadBlockingError { get => this._fileUploadBlockingError; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo _fullBackupSetInfo; + + /// Details of full backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo FullBackupSetInfo { get => (this._fullBackupSetInfo = this._fullBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo()); } + + /// Backup end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? FullBackupSetInfoBackupFinishDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupFinishDate; } + + /// Backup set id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoBackupSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupSetId; } + + /// Backup start date. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? FullBackupSetInfoBackupStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupStartDate; } + + /// Backup type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupType; } + + /// Media family count + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? FullBackupSetInfoFamilyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).FamilyCount; } + + /// First LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoFirstLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).FirstLsn; } + + /// Has Backup Checksums + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? FullBackupSetInfoHasBackupChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).HasBackupChecksum; } + + /// The reasons why the backup set is ignored + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] FullBackupSetInfoIgnoreReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).IgnoreReason; } + + /// Whether this backup set has been restored or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? FullBackupSetInfoIsBackupRestored { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).IsBackupRestored; } + + /// Last LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FullBackupSetInfoLastLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).LastLsn; } + + /// List of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] FullBackupSetInfoListOfBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).ListOfBackupFile; } + + /// Backing field for property. + private string[] _invalidFile; + + /// Files that are not valid backup files. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] InvalidFile { get => this._invalidFile; } + + /// Backing field for property. + private bool? _isFullBackupRestored; + + /// Whether full backup has been applied to the target database or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsFullBackupRestored { get => this._isFullBackupRestored; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo _lastRestoredBackupSetInfo; + + /// Last applied backup set information. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo LastRestoredBackupSetInfo { get => (this._lastRestoredBackupSetInfo = this._lastRestoredBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo()); } + + /// Backup end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? LastRestoredBackupSetInfoBackupFinishDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupFinishDate; } + + /// Backup set id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoBackupSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupSetId; } + + /// Backup start date. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? LastRestoredBackupSetInfoBackupStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupStartDate; } + + /// Backup type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupType; } + + /// Media family count + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? LastRestoredBackupSetInfoFamilyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).FamilyCount; } + + /// First LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoFirstLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).FirstLsn; } + + /// Has Backup Checksums + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? LastRestoredBackupSetInfoHasBackupChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).HasBackupChecksum; } + + /// The reasons why the backup set is ignored + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] LastRestoredBackupSetInfoIgnoreReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).IgnoreReason; } + + /// Whether this backup set has been restored or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? LastRestoredBackupSetInfoIsBackupRestored { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).IsBackupRestored; } + + /// Last LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string LastRestoredBackupSetInfoLastLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).LastLsn; } + + /// List of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] LastRestoredBackupSetInfoListOfBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).ListOfBackupFile; } + + /// Backing field for property. + private string _lastRestoredFilename; + + /// Last restored file name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LastRestoredFilename { get => this._lastRestoredFilename; } + + /// Internal Acessors for ActiveBackupSet + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.ActiveBackupSet { get => this._activeBackupSet; set { {_activeBackupSet = value;} } } + + /// Internal Acessors for BlobContainerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.BlobContainerName { get => this._blobContainerName; set { {_blobContainerName = value;} } } + + /// Internal Acessors for CompleteRestoreErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.CompleteRestoreErrorMessage { get => this._completeRestoreErrorMessage; set { {_completeRestoreErrorMessage = value;} } } + + /// Internal Acessors for CurrentRestoringFilename + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.CurrentRestoringFilename { get => this._currentRestoringFilename; set { {_currentRestoringFilename = value;} } } + + /// Internal Acessors for FileUploadBlockingError + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FileUploadBlockingError { get => this._fileUploadBlockingError; set { {_fileUploadBlockingError = value;} } } + + /// Internal Acessors for FullBackupSetInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfo { get => (this._fullBackupSetInfo = this._fullBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo()); set { {_fullBackupSetInfo = value;} } } + + /// Internal Acessors for FullBackupSetInfoBackupFinishDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoBackupFinishDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupFinishDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupFinishDate = value; } + + /// Internal Acessors for FullBackupSetInfoBackupSetId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoBackupSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupSetId = value; } + + /// Internal Acessors for FullBackupSetInfoBackupStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoBackupStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupStartDate = value; } + + /// Internal Acessors for FullBackupSetInfoBackupType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).BackupType = value; } + + /// Internal Acessors for FullBackupSetInfoFamilyCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoFamilyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).FamilyCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).FamilyCount = value; } + + /// Internal Acessors for FullBackupSetInfoFirstLsn + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoFirstLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).FirstLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).FirstLsn = value; } + + /// Internal Acessors for FullBackupSetInfoHasBackupChecksum + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoHasBackupChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).HasBackupChecksum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).HasBackupChecksum = value; } + + /// Internal Acessors for FullBackupSetInfoIgnoreReason + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoIgnoreReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).IgnoreReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).IgnoreReason = value; } + + /// Internal Acessors for FullBackupSetInfoIsBackupRestored + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoIsBackupRestored { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).IsBackupRestored; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).IsBackupRestored = value; } + + /// Internal Acessors for FullBackupSetInfoLastLsn + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoLastLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).LastLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).LastLsn = value; } + + /// Internal Acessors for FullBackupSetInfoListOfBackupFile + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.FullBackupSetInfoListOfBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).ListOfBackupFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)FullBackupSetInfo).ListOfBackupFile = value; } + + /// Internal Acessors for InvalidFile + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.InvalidFile { get => this._invalidFile; set { {_invalidFile = value;} } } + + /// Internal Acessors for IsFullBackupRestored + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.IsFullBackupRestored { get => this._isFullBackupRestored; set { {_isFullBackupRestored = value;} } } + + /// Internal Acessors for LastRestoredBackupSetInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfo { get => (this._lastRestoredBackupSetInfo = this._lastRestoredBackupSetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo()); set { {_lastRestoredBackupSetInfo = value;} } } + + /// Internal Acessors for LastRestoredBackupSetInfoBackupFinishDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoBackupFinishDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupFinishDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupFinishDate = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoBackupSetId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoBackupSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupSetId = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoBackupStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoBackupStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupStartDate = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoBackupType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).BackupType = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoFamilyCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoFamilyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).FamilyCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).FamilyCount = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoFirstLsn + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoFirstLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).FirstLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).FirstLsn = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoHasBackupChecksum + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoHasBackupChecksum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).HasBackupChecksum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).HasBackupChecksum = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoIgnoreReason + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoIgnoreReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).IgnoreReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).IgnoreReason = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoIsBackupRestored + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoIsBackupRestored { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).IsBackupRestored; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).IsBackupRestored = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoLastLsn + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoLastLsn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).LastLsn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).LastLsn = value; } + + /// Internal Acessors for LastRestoredBackupSetInfoListOfBackupFile + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredBackupSetInfoListOfBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).ListOfBackupFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)LastRestoredBackupSetInfo).ListOfBackupFile = value; } + + /// Internal Acessors for LastRestoredFilename + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.LastRestoredFilename { get => this._lastRestoredFilename; set { {_lastRestoredFilename = value;} } } + + /// Internal Acessors for MigrationState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for PendingLogBackupsCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.PendingLogBackupsCount { get => this._pendingLogBackupsCount; set { {_pendingLogBackupsCount = value;} } } + + /// Internal Acessors for RestoreBlockingReason + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetailsInternal.RestoreBlockingReason { get => this._restoreBlockingReason; set { {_restoreBlockingReason = value;} } } + + /// Backing field for property. + private string _migrationState; + + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationState { get => this._migrationState; } + + /// Backing field for property. + private int? _pendingLogBackupsCount; + + /// Total pending log backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? PendingLogBackupsCount { get => this._pendingLogBackupsCount; } + + /// Backing field for property. + private string _restoreBlockingReason; + + /// Restore blocking reason, if any + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string RestoreBlockingReason { get => this._restoreBlockingReason; } + + /// Creates an new instance. + public MigrationStatusDetails() + { + + } + } + /// Detailed status of current migration. + public partial interface IMigrationStatusDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Backup sets that are currently active. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup sets that are currently active.", + SerializedName = @"activeBackupSets", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo[] ActiveBackupSet { get; } + /// Name of blob container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of blob container.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string BlobContainerName { get; } + /// Complete restore error message, if any + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Complete restore error message, if any", + SerializedName = @"completeRestoreErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string CompleteRestoreErrorMessage { get; } + /// File name that is currently being restored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"File name that is currently being restored.", + SerializedName = @"currentRestoringFilename", + PossibleTypes = new [] { typeof(string) })] + string CurrentRestoringFilename { get; } + /// File upload blocking errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"File upload blocking errors, if any.", + SerializedName = @"fileUploadBlockingErrors", + PossibleTypes = new [] { typeof(string) })] + string[] FileUploadBlockingError { get; } + /// Backup end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup end time.", + SerializedName = @"backupFinishDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullBackupSetInfoBackupFinishDate { get; } + /// Backup set id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup set id.", + SerializedName = @"backupSetId", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoBackupSetId { get; } + /// Backup start date. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup start date.", + SerializedName = @"backupStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FullBackupSetInfoBackupStartDate { get; } + /// Backup type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup type.", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoBackupType { get; } + /// Media family count + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Media family count", + SerializedName = @"familyCount", + PossibleTypes = new [] { typeof(int) })] + int? FullBackupSetInfoFamilyCount { get; } + /// First LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"First LSN of the backup set.", + SerializedName = @"firstLSN", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoFirstLsn { get; } + /// Has Backup Checksums + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Has Backup Checksums", + SerializedName = @"hasBackupChecksums", + PossibleTypes = new [] { typeof(bool) })] + bool? FullBackupSetInfoHasBackupChecksum { get; } + /// The reasons why the backup set is ignored + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reasons why the backup set is ignored", + SerializedName = @"ignoreReasons", + PossibleTypes = new [] { typeof(string) })] + string[] FullBackupSetInfoIgnoreReason { get; } + /// Whether this backup set has been restored or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether this backup set has been restored or not.", + SerializedName = @"isBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? FullBackupSetInfoIsBackupRestored { get; } + /// Last LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last LSN of the backup set.", + SerializedName = @"lastLSN", + PossibleTypes = new [] { typeof(string) })] + string FullBackupSetInfoLastLsn { get; } + /// List of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of files in the backup set.", + SerializedName = @"listOfBackupFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] FullBackupSetInfoListOfBackupFile { get; } + /// Files that are not valid backup files. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Files that are not valid backup files.", + SerializedName = @"invalidFiles", + PossibleTypes = new [] { typeof(string) })] + string[] InvalidFile { get; } + /// Whether full backup has been applied to the target database or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether full backup has been applied to the target database or not.", + SerializedName = @"isFullBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? IsFullBackupRestored { get; } + /// Backup end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup end time.", + SerializedName = @"backupFinishDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRestoredBackupSetInfoBackupFinishDate { get; } + /// Backup set id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup set id.", + SerializedName = @"backupSetId", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoBackupSetId { get; } + /// Backup start date. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup start date.", + SerializedName = @"backupStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRestoredBackupSetInfoBackupStartDate { get; } + /// Backup type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup type.", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoBackupType { get; } + /// Media family count + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Media family count", + SerializedName = @"familyCount", + PossibleTypes = new [] { typeof(int) })] + int? LastRestoredBackupSetInfoFamilyCount { get; } + /// First LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"First LSN of the backup set.", + SerializedName = @"firstLSN", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoFirstLsn { get; } + /// Has Backup Checksums + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Has Backup Checksums", + SerializedName = @"hasBackupChecksums", + PossibleTypes = new [] { typeof(bool) })] + bool? LastRestoredBackupSetInfoHasBackupChecksum { get; } + /// The reasons why the backup set is ignored + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reasons why the backup set is ignored", + SerializedName = @"ignoreReasons", + PossibleTypes = new [] { typeof(string) })] + string[] LastRestoredBackupSetInfoIgnoreReason { get; } + /// Whether this backup set has been restored or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether this backup set has been restored or not.", + SerializedName = @"isBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? LastRestoredBackupSetInfoIsBackupRestored { get; } + /// Last LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last LSN of the backup set.", + SerializedName = @"lastLSN", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredBackupSetInfoLastLsn { get; } + /// List of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of files in the backup set.", + SerializedName = @"listOfBackupFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] LastRestoredBackupSetInfoListOfBackupFile { get; } + /// Last restored file name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last restored file name.", + SerializedName = @"lastRestoredFilename", + PossibleTypes = new [] { typeof(string) })] + string LastRestoredFilename { get; } + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current State of Migration.", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(string) })] + string MigrationState { get; } + /// Total pending log backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total pending log backups.", + SerializedName = @"pendingLogBackupsCount", + PossibleTypes = new [] { typeof(int) })] + int? PendingLogBackupsCount { get; } + /// Restore blocking reason, if any + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Restore blocking reason, if any", + SerializedName = @"restoreBlockingReason", + PossibleTypes = new [] { typeof(string) })] + string RestoreBlockingReason { get; } + + } + /// Detailed status of current migration. + internal partial interface IMigrationStatusDetailsInternal + + { + /// Backup sets that are currently active. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo[] ActiveBackupSet { get; set; } + /// Name of blob container. + string BlobContainerName { get; set; } + /// Complete restore error message, if any + string CompleteRestoreErrorMessage { get; set; } + /// File name that is currently being restored. + string CurrentRestoringFilename { get; set; } + /// File upload blocking errors, if any. + string[] FileUploadBlockingError { get; set; } + /// Details of full backup set. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo FullBackupSetInfo { get; set; } + /// Backup end time. + global::System.DateTime? FullBackupSetInfoBackupFinishDate { get; set; } + /// Backup set id. + string FullBackupSetInfoBackupSetId { get; set; } + /// Backup start date. + global::System.DateTime? FullBackupSetInfoBackupStartDate { get; set; } + /// Backup type. + string FullBackupSetInfoBackupType { get; set; } + /// Media family count + int? FullBackupSetInfoFamilyCount { get; set; } + /// First LSN of the backup set. + string FullBackupSetInfoFirstLsn { get; set; } + /// Has Backup Checksums + bool? FullBackupSetInfoHasBackupChecksum { get; set; } + /// The reasons why the backup set is ignored + string[] FullBackupSetInfoIgnoreReason { get; set; } + /// Whether this backup set has been restored or not. + bool? FullBackupSetInfoIsBackupRestored { get; set; } + /// Last LSN of the backup set. + string FullBackupSetInfoLastLsn { get; set; } + /// List of files in the backup set. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] FullBackupSetInfoListOfBackupFile { get; set; } + /// Files that are not valid backup files. + string[] InvalidFile { get; set; } + /// Whether full backup has been applied to the target database or not. + bool? IsFullBackupRestored { get; set; } + /// Last applied backup set information. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo LastRestoredBackupSetInfo { get; set; } + /// Backup end time. + global::System.DateTime? LastRestoredBackupSetInfoBackupFinishDate { get; set; } + /// Backup set id. + string LastRestoredBackupSetInfoBackupSetId { get; set; } + /// Backup start date. + global::System.DateTime? LastRestoredBackupSetInfoBackupStartDate { get; set; } + /// Backup type. + string LastRestoredBackupSetInfoBackupType { get; set; } + /// Media family count + int? LastRestoredBackupSetInfoFamilyCount { get; set; } + /// First LSN of the backup set. + string LastRestoredBackupSetInfoFirstLsn { get; set; } + /// Has Backup Checksums + bool? LastRestoredBackupSetInfoHasBackupChecksum { get; set; } + /// The reasons why the backup set is ignored + string[] LastRestoredBackupSetInfoIgnoreReason { get; set; } + /// Whether this backup set has been restored or not. + bool? LastRestoredBackupSetInfoIsBackupRestored { get; set; } + /// Last LSN of the backup set. + string LastRestoredBackupSetInfoLastLsn { get; set; } + /// List of files in the backup set. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] LastRestoredBackupSetInfoListOfBackupFile { get; set; } + /// Last restored file name. + string LastRestoredFilename { get; set; } + /// Current State of Migration. + string MigrationState { get; set; } + /// Total pending log backups. + int? PendingLogBackupsCount { get; set; } + /// Restore blocking reason, if any + string RestoreBlockingReason { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.json.cs new file mode 100644 index 000000000000..426588576b1c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationStatusDetails.json.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Detailed status of current migration. + public partial class MigrationStatusDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationStatusDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationStatusDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationStatusDetails(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_fullBackupSetInfo = If( json?.PropertyT("fullBackupSetInfo"), out var __jsonFullBackupSetInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo.FromJson(__jsonFullBackupSetInfo) : FullBackupSetInfo;} + {_lastRestoredBackupSetInfo = If( json?.PropertyT("lastRestoredBackupSetInfo"), out var __jsonLastRestoredBackupSetInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo.FromJson(__jsonLastRestoredBackupSetInfo) : LastRestoredBackupSetInfo;} + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + {_activeBackupSet = If( json?.PropertyT("activeBackupSets"), out var __jsonActiveBackupSets) ? If( __jsonActiveBackupSets as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupSetInfo.FromJson(__u) )) ))() : null : ActiveBackupSet;} + {_invalidFile = If( json?.PropertyT("invalidFiles"), out var __jsonInvalidFiles) ? If( __jsonInvalidFiles as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : InvalidFile;} + {_blobContainerName = If( json?.PropertyT("blobContainerName"), out var __jsonBlobContainerName) ? (string)__jsonBlobContainerName : (string)BlobContainerName;} + {_isFullBackupRestored = If( json?.PropertyT("isFullBackupRestored"), out var __jsonIsFullBackupRestored) ? (bool?)__jsonIsFullBackupRestored : IsFullBackupRestored;} + {_restoreBlockingReason = If( json?.PropertyT("restoreBlockingReason"), out var __jsonRestoreBlockingReason) ? (string)__jsonRestoreBlockingReason : (string)RestoreBlockingReason;} + {_completeRestoreErrorMessage = If( json?.PropertyT("completeRestoreErrorMessage"), out var __jsonCompleteRestoreErrorMessage) ? (string)__jsonCompleteRestoreErrorMessage : (string)CompleteRestoreErrorMessage;} + {_fileUploadBlockingError = If( json?.PropertyT("fileUploadBlockingErrors"), out var __jsonFileUploadBlockingErrors) ? If( __jsonFileUploadBlockingErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : FileUploadBlockingError;} + {_currentRestoringFilename = If( json?.PropertyT("currentRestoringFilename"), out var __jsonCurrentRestoringFilename) ? (string)__jsonCurrentRestoringFilename : (string)CurrentRestoringFilename;} + {_lastRestoredFilename = If( json?.PropertyT("lastRestoredFilename"), out var __jsonLastRestoredFilename) ? (string)__jsonLastRestoredFilename : (string)LastRestoredFilename;} + {_pendingLogBackupsCount = If( json?.PropertyT("pendingLogBackupsCount"), out var __jsonPendingLogBackupsCount) ? (int?)__jsonPendingLogBackupsCount : PendingLogBackupsCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._fullBackupSetInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._fullBackupSetInfo.ToJson(null,serializationMode) : null, "fullBackupSetInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastRestoredBackupSetInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._lastRestoredBackupSetInfo.ToJson(null,serializationMode) : null, "lastRestoredBackupSetInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._activeBackupSet) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._activeBackupSet ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("activeBackupSets",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._invalidFile) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._invalidFile ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("invalidFiles",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._blobContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._blobContainerName.ToString()) : null, "blobContainerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isFullBackupRestored ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isFullBackupRestored) : null, "isFullBackupRestored" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._restoreBlockingReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._restoreBlockingReason.ToString()) : null, "restoreBlockingReason" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._completeRestoreErrorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._completeRestoreErrorMessage.ToString()) : null, "completeRestoreErrorMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._fileUploadBlockingError) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __n in this._fileUploadBlockingError ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("fileUploadBlockingErrors",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currentRestoringFilename)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._currentRestoringFilename.ToString()) : null, "currentRestoringFilename" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastRestoredFilename)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastRestoredFilename.ToString()) : null, "lastRestoredFilename" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._pendingLogBackupsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._pendingLogBackupsCount) : null, "pendingLogBackupsCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.PowerShell.cs new file mode 100644 index 000000000000..a93116eac79a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Metadata for tables selected in migration project + [System.ComponentModel.TypeConverter(typeof(MigrationTableMetadataTypeConverter))] + public partial class MigrationTableMetadata + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationTableMetadata(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationTableMetadata(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationTableMetadata(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceTableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).SourceTableName = (string) content.GetValueForProperty("SourceTableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).SourceTableName, global::System.Convert.ToString); + } + if (content.Contains("TargetTableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).TargetTableName = (string) content.GetValueForProperty("TargetTableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).TargetTableName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationTableMetadata(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceTableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).SourceTableName = (string) content.GetValueForProperty("SourceTableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).SourceTableName, global::System.Convert.ToString); + } + if (content.Contains("TargetTableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).TargetTableName = (string) content.GetValueForProperty("TargetTableName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal)this).TargetTableName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metadata for tables selected in migration project + [System.ComponentModel.TypeConverter(typeof(MigrationTableMetadataTypeConverter))] + public partial interface IMigrationTableMetadata + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.TypeConverter.cs new file mode 100644 index 000000000000..f202cbc9aced --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationTableMetadataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationTableMetadata.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationTableMetadata.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationTableMetadata.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.cs new file mode 100644 index 000000000000..62855177abdb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Metadata for tables selected in migration project + public partial class MigrationTableMetadata : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal + { + + /// Internal Acessors for SourceTableName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal.SourceTableName { get => this._sourceTableName; set { {_sourceTableName = value;} } } + + /// Internal Acessors for TargetTableName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadataInternal.TargetTableName { get => this._targetTableName; set { {_targetTableName = value;} } } + + /// Backing field for property. + private string _sourceTableName; + + /// Source table name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceTableName { get => this._sourceTableName; } + + /// Backing field for property. + private string _targetTableName; + + /// Target table name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetTableName { get => this._targetTableName; } + + /// Creates an new instance. + public MigrationTableMetadata() + { + + } + } + /// Metadata for tables selected in migration project + public partial interface IMigrationTableMetadata : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Source table name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Source table name", + SerializedName = @"sourceTableName", + PossibleTypes = new [] { typeof(string) })] + string SourceTableName { get; } + /// Target table name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Target table name", + SerializedName = @"targetTableName", + PossibleTypes = new [] { typeof(string) })] + string TargetTableName { get; } + + } + /// Metadata for tables selected in migration project + internal partial interface IMigrationTableMetadataInternal + + { + /// Source table name + string SourceTableName { get; set; } + /// Target table name + string TargetTableName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.json.cs new file mode 100644 index 000000000000..04d8d11612c0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationTableMetadata.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Metadata for tables selected in migration project + public partial class MigrationTableMetadata + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationTableMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationTableMetadata(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationTableMetadata(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceTableName = If( json?.PropertyT("sourceTableName"), out var __jsonSourceTableName) ? (string)__jsonSourceTableName : (string)SourceTableName;} + {_targetTableName = If( json?.PropertyT("targetTableName"), out var __jsonTargetTableName) ? (string)__jsonTargetTableName : (string)TargetTableName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceTableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceTableName.ToString()) : null, "sourceTableName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetTableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetTableName.ToString()) : null, "targetTableName" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.PowerShell.cs new file mode 100644 index 000000000000..c7b51a360df5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.PowerShell.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database level validation results + [System.ComponentModel.TypeConverter(typeof(MigrationValidationDatabaseLevelResultTypeConverter))] + public partial class MigrationValidationDatabaseLevelResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationValidationDatabaseLevelResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationValidationDatabaseLevelResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationValidationDatabaseLevelResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataIntegrityValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult) content.GetValueForProperty("DataIntegrityValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult) content.GetValueForProperty("SchemaValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult) content.GetValueForProperty("QueryAnalysisValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryAnalysisValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + if (content.Contains("DataIntegrityValidationResultFailedObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) content.GetValueForProperty("DataIntegrityValidationResultFailedObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjectsTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("DataIntegrityValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("SchemaValidationResultSchemaDifference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType) content.GetValueForProperty("SchemaValidationResultSchemaDifference",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("SchemaValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultSourceDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultSourceDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultTargetDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultTargetDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaDifferenceObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("SchemaDifferenceObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("SchemaValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("QueryAnalysisValidationResultQueryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult) content.GetValueForProperty("QueryAnalysisValidationResultQueryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("QueryAnalysisValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText = (string) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName = (string) content.GetValueForProperty("SchemaDifferenceObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceUpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("SchemaDifferenceUpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText = (string) content.GetValueForProperty("SchemaValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultSourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultSourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultTargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultTargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultQueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText = (string) content.GetValueForProperty("QueryResultQueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultStatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch = (long?) content.GetValueForProperty("QueryResultStatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText = (string) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationValidationDatabaseLevelResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataIntegrityValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult) content.GetValueForProperty("DataIntegrityValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult) content.GetValueForProperty("SchemaValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult) content.GetValueForProperty("QueryAnalysisValidationResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryAnalysisValidationResultTypeConverter.ConvertFrom); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + if (content.Contains("DataIntegrityValidationResultFailedObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) content.GetValueForProperty("DataIntegrityValidationResultFailedObject",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultFailedObject, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResultFailedObjectsTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("DataIntegrityValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("SchemaValidationResultSchemaDifference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType) content.GetValueForProperty("SchemaValidationResultSchemaDifference",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSchemaDifference, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("SchemaValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultSourceDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultSourceDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultSourceDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaValidationResultTargetDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) content.GetValueForProperty("SchemaValidationResultTargetDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultTargetDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaDifferenceObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("SchemaDifferenceObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("SchemaValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("QueryAnalysisValidationResultQueryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult) content.GetValueForProperty("QueryAnalysisValidationResultQueryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultQueryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResultTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("QueryAnalysisValidationResultValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("DataIntegrityValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText = (string) content.GetValueForProperty("DataIntegrityValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).DataIntegrityValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName = (string) content.GetValueForProperty("SchemaDifferenceObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceUpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("SchemaDifferenceUpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaDifferenceUpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + if (content.Contains("SchemaValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText = (string) content.GetValueForProperty("SchemaValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SchemaValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultSourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultSourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultSourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultTargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultTargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultTargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultQueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText = (string) content.GetValueForProperty("QueryResultQueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultQueryText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultStatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch = (long?) content.GetValueForProperty("QueryResultStatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryResultStatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("QueryAnalysisValidationResultValidationErrorsText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText = (string) content.GetValueForProperty("QueryAnalysisValidationResultValidationErrorsText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).QueryAnalysisValidationResultValidationErrorsText, global::System.Convert.ToString); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database level validation results + [System.ComponentModel.TypeConverter(typeof(MigrationValidationDatabaseLevelResultTypeConverter))] + public partial interface IMigrationValidationDatabaseLevelResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.TypeConverter.cs new file mode 100644 index 000000000000..4c352bcd790e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationValidationDatabaseLevelResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationValidationDatabaseLevelResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationValidationDatabaseLevelResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationValidationDatabaseLevelResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.cs new file mode 100644 index 000000000000..252b95b57271 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.cs @@ -0,0 +1,597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database level validation results + public partial class MigrationValidationDatabaseLevelResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult _dataIntegrityValidationResult; + + /// + /// Provides data integrity validation result between the source and target tables that are migrated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult DataIntegrityValidationResult { get => (this._dataIntegrityValidationResult = this._dataIntegrityValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResult()); } + + /// List of failed table names of source and target pair + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects DataIntegrityValidationResultFailedObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).FailedObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).FailedObject = value ?? null /* model class */; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? DataIntegrityValidationResultValidationErrorsSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).ValidationErrorSeverity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).ValidationErrorSeverity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DataIntegrityValidationResultValidationErrorsText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).ValidationErrorText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).ValidationErrorText = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Validation end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Internal Acessors for DataIntegrityValidationResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.DataIntegrityValidationResult { get => (this._dataIntegrityValidationResult = this._dataIntegrityValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResult()); set { {_dataIntegrityValidationResult = value;} } } + + /// Internal Acessors for DataIntegrityValidationResultValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.DataIntegrityValidationResultValidationError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).ValidationError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultInternal)DataIntegrityValidationResult).ValidationError = value; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for MigrationId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.MigrationId { get => this._migrationId; set { {_migrationId = value;} } } + + /// Internal Acessors for QueryAnalysisValidationResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.QueryAnalysisValidationResult { get => (this._queryAnalysisValidationResult = this._queryAnalysisValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryAnalysisValidationResult()); set { {_queryAnalysisValidationResult = value;} } } + + /// Internal Acessors for QueryAnalysisValidationResultQueryResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.QueryAnalysisValidationResultQueryResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResult = value; } + + /// Internal Acessors for QueryAnalysisValidationResultValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.QueryAnalysisValidationResultValidationError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).ValidationError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).ValidationError = value; } + + /// Internal Acessors for QueryResultSourceResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.QueryResultSourceResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultSourceResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultSourceResult = value; } + + /// Internal Acessors for QueryResultTargetResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.QueryResultTargetResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultTargetResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultTargetResult = value; } + + /// Internal Acessors for SchemaValidationResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.SchemaValidationResult { get => (this._schemaValidationResult = this._schemaValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResult()); set { {_schemaValidationResult = value;} } } + + /// Internal Acessors for SchemaValidationResultSchemaDifference + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.SchemaValidationResultSchemaDifference { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifference; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifference = value; } + + /// Internal Acessors for SchemaValidationResultValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.SchemaValidationResultValidationError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).ValidationError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).ValidationError = value; } + + /// Internal Acessors for SourceDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.SourceDatabaseName { get => this._sourceDatabaseName; set { {_sourceDatabaseName = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TargetDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResultInternal.TargetDatabaseName { get => this._targetDatabaseName; set { {_targetDatabaseName = value;} } } + + /// Backing field for property. + private string _migrationId; + + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationId { get => this._migrationId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult _queryAnalysisValidationResult; + + /// + /// Results of some of the query execution result between source and target database + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult QueryAnalysisValidationResult { get => (this._queryAnalysisValidationResult = this._queryAnalysisValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryAnalysisValidationResult()); } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? QueryAnalysisValidationResultValidationErrorsSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).ValidationErrorSeverity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).ValidationErrorSeverity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string QueryAnalysisValidationResultValidationErrorsText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).ValidationErrorText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).ValidationErrorText = value ?? null; } + + /// Query text retrieved from the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string QueryResultQueryText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultQueryText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultQueryText = value ?? null; } + + /// Total no. of statements in the batch + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? QueryResultStatementsInBatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultStatementsInBatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).QueryResultStatementsInBatch = value ?? default(long); } + + /// Name of the object that has the difference + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SchemaDifferenceObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifferenceObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifferenceObjectName = value ?? null; } + + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? SchemaDifferenceObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifferenceObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifferenceObjectType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType)""); } + + /// Update action type with respect to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? SchemaDifferenceUpdateAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifferenceUpdateAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SchemaDifferenceUpdateAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult _schemaValidationResult; + + /// Provides schema comparison result between source and target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult SchemaValidationResult { get => (this._schemaValidationResult = this._schemaValidationResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResult()); } + + /// Count of source database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount SchemaValidationResultSourceDatabaseObjectCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SourceDatabaseObjectCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).SourceDatabaseObjectCount = value ?? null /* model class */; } + + /// Count of target database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount SchemaValidationResultTargetDatabaseObjectCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).TargetDatabaseObjectCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).TargetDatabaseObjectCount = value ?? null /* model class */; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? SchemaValidationResultValidationErrorsSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).ValidationErrorSeverity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).ValidationErrorSeverity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SchemaValidationResultValidationErrorsText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).ValidationErrorText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)SchemaValidationResult).ValidationErrorText = value ?? null; } + + /// Backing field for property. + private string _sourceDatabaseName; + + /// Name of the source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceDatabaseName { get => this._sourceDatabaseName; } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? SourceResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultCpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultCpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? SourceResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? SourceResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultHasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultHasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] SourceResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultSqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultSqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultWaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).SourceResultWaitStat = value ?? null /* model class */; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Validation start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? _status; + + /// Current status of validation at the database level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get => this._status; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// Name of the target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? TargetResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultCpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultCpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? TargetResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? TargetResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultHasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultHasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] TargetResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultSqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultSqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultWaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)QueryAnalysisValidationResult).TargetResultWaitStat = value ?? null /* model class */; } + + /// Creates an new instance. + public MigrationValidationDatabaseLevelResult() + { + + } + } + /// Database level validation results + public partial interface IMigrationValidationDatabaseLevelResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// List of failed table names of source and target pair + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of failed table names of source and target pair", + SerializedName = @"failedObjects", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects DataIntegrityValidationResultFailedObject { get; set; } + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the error", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? DataIntegrityValidationResultValidationErrorsSeverity { get; set; } + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Text", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string DataIntegrityValidationResultValidationErrorsText { get; set; } + /// Validation end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration Identifier", + SerializedName = @"migrationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationId { get; } + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the error", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? QueryAnalysisValidationResultValidationErrorsSeverity { get; set; } + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Text", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string QueryAnalysisValidationResultValidationErrorsText { get; set; } + /// Query text retrieved from the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query text retrieved from the source server", + SerializedName = @"queryText", + PossibleTypes = new [] { typeof(string) })] + string QueryResultQueryText { get; set; } + /// Total no. of statements in the batch + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total no. of statements in the batch", + SerializedName = @"statementsInBatch", + PossibleTypes = new [] { typeof(long) })] + long? QueryResultStatementsInBatch { get; set; } + /// Name of the object that has the difference + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the object that has the difference", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string SchemaDifferenceObjectName { get; set; } + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the object that has the difference. e.g (Table/View/StoredProcedure)", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? SchemaDifferenceObjectType { get; set; } + /// Update action type with respect to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Update action type with respect to target", + SerializedName = @"updateAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? SchemaDifferenceUpdateAction { get; set; } + /// Count of source database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Count of source database objects", + SerializedName = @"sourceDatabaseObjectCount", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount SchemaValidationResultSourceDatabaseObjectCount { get; set; } + /// Count of target database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Count of target database objects", + SerializedName = @"targetDatabaseObjectCount", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount SchemaValidationResultTargetDatabaseObjectCount { get; set; } + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the error", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? SchemaValidationResultValidationErrorsSeverity { get; set; } + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Text", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string SchemaValidationResultValidationErrorsText { get; set; } + /// Name of the source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source database", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; } + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CPU Time in millisecond(s) for the query execution", + SerializedName = @"cpuTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? SourceResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken in millisecond(s) for executing the query", + SerializedName = @"elapsedTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? SourceResultElapsedTimeMS { get; set; } + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"No. of query executions", + SerializedName = @"executionCount", + PossibleTypes = new [] { typeof(long) })] + long? SourceResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the query resulted in an error", + SerializedName = @"hasErrors", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceResultHasError { get; set; } + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sql Errors", + SerializedName = @"sqlErrors", + PossibleTypes = new [] { typeof(string) })] + string[] SourceResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of sql query execution wait types and the respective statistics", + SerializedName = @"waitStats", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get; set; } + /// Validation start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current status of validation at the database level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of validation at the database level", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get; } + /// Name of the target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the target database", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; } + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CPU Time in millisecond(s) for the query execution", + SerializedName = @"cpuTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? TargetResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken in millisecond(s) for executing the query", + SerializedName = @"elapsedTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? TargetResultElapsedTimeMS { get; set; } + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"No. of query executions", + SerializedName = @"executionCount", + PossibleTypes = new [] { typeof(long) })] + long? TargetResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the query resulted in an error", + SerializedName = @"hasErrors", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetResultHasError { get; set; } + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sql Errors", + SerializedName = @"sqlErrors", + PossibleTypes = new [] { typeof(string) })] + string[] TargetResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of sql query execution wait types and the respective statistics", + SerializedName = @"waitStats", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get; set; } + + } + /// Database level validation results + internal partial interface IMigrationValidationDatabaseLevelResultInternal + + { + /// + /// Provides data integrity validation result between the source and target tables that are migrated. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResult DataIntegrityValidationResult { get; set; } + /// List of failed table names of source and target pair + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataIntegrityValidationResultFailedObjects DataIntegrityValidationResultFailedObject { get; set; } + /// List of errors that happened while performing data integrity validation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError DataIntegrityValidationResultValidationError { get; set; } + /// Severity of the error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? DataIntegrityValidationResultValidationErrorsSeverity { get; set; } + /// Error Text + string DataIntegrityValidationResultValidationErrorsText { get; set; } + /// Validation end time + global::System.DateTime? EndedOn { get; set; } + /// Migration Identifier + string MigrationId { get; set; } + /// + /// Results of some of the query execution result between source and target database + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult QueryAnalysisValidationResult { get; set; } + /// List of queries executed and it's execution results in source and target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult QueryAnalysisValidationResultQueryResult { get; set; } + /// Errors that are part of the execution + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError QueryAnalysisValidationResultValidationError { get; set; } + /// Severity of the error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? QueryAnalysisValidationResultValidationErrorsSeverity { get; set; } + /// Error Text + string QueryAnalysisValidationResultValidationErrorsText { get; set; } + /// Query text retrieved from the source server + string QueryResultQueryText { get; set; } + /// Query analysis result from the source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics QueryResultSourceResult { get; set; } + /// Total no. of statements in the batch + long? QueryResultStatementsInBatch { get; set; } + /// Query analysis result from the target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics QueryResultTargetResult { get; set; } + /// Name of the object that has the difference + string SchemaDifferenceObjectName { get; set; } + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? SchemaDifferenceObjectType { get; set; } + /// Update action type with respect to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? SchemaDifferenceUpdateAction { get; set; } + /// Provides schema comparison result between source and target database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult SchemaValidationResult { get; set; } + /// List of schema differences between the source and target databases + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType SchemaValidationResultSchemaDifference { get; set; } + /// Count of source database objects + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount SchemaValidationResultSourceDatabaseObjectCount { get; set; } + /// Count of target database objects + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount SchemaValidationResultTargetDatabaseObjectCount { get; set; } + /// List of errors that happened while performing schema compare validation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError SchemaValidationResultValidationError { get; set; } + /// Severity of the error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? SchemaValidationResultValidationErrorsSeverity { get; set; } + /// Error Text + string SchemaValidationResultValidationErrorsText { get; set; } + /// Name of the source database + string SourceDatabaseName { get; set; } + /// CPU Time in millisecond(s) for the query execution + float? SourceResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + float? SourceResultElapsedTimeMS { get; set; } + /// No. of query executions + long? SourceResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + bool? SourceResultHasError { get; set; } + /// List of sql Errors + string[] SourceResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get; set; } + /// Validation start time + global::System.DateTime? StartedOn { get; set; } + /// Current status of validation at the database level + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get; set; } + /// Name of the target database + string TargetDatabaseName { get; set; } + /// CPU Time in millisecond(s) for the query execution + float? TargetResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + float? TargetResultElapsedTimeMS { get; set; } + /// No. of query executions + long? TargetResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + bool? TargetResultHasError { get; set; } + /// List of sql Errors + string[] TargetResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.json.cs new file mode 100644 index 000000000000..917d5c08a5d1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseLevelResult.json.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database level validation results + public partial class MigrationValidationDatabaseLevelResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseLevelResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationValidationDatabaseLevelResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationValidationDatabaseLevelResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dataIntegrityValidationResult = If( json?.PropertyT("dataIntegrityValidationResult"), out var __jsonDataIntegrityValidationResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataIntegrityValidationResult.FromJson(__jsonDataIntegrityValidationResult) : DataIntegrityValidationResult;} + {_schemaValidationResult = If( json?.PropertyT("schemaValidationResult"), out var __jsonSchemaValidationResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResult.FromJson(__jsonSchemaValidationResult) : SchemaValidationResult;} + {_queryAnalysisValidationResult = If( json?.PropertyT("queryAnalysisValidationResult"), out var __jsonQueryAnalysisValidationResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryAnalysisValidationResult.FromJson(__jsonQueryAnalysisValidationResult) : QueryAnalysisValidationResult;} + {_migrationId = If( json?.PropertyT("migrationId"), out var __jsonMigrationId) ? (string)__jsonMigrationId : (string)MigrationId;} + {_sourceDatabaseName = If( json?.PropertyT("sourceDatabaseName"), out var __jsonSourceDatabaseName) ? (string)__jsonSourceDatabaseName : (string)SourceDatabaseName;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataIntegrityValidationResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._dataIntegrityValidationResult.ToJson(null,serializationMode) : null, "dataIntegrityValidationResult" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._schemaValidationResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._schemaValidationResult.ToJson(null,serializationMode) : null, "schemaValidationResult" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._queryAnalysisValidationResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._queryAnalysisValidationResult.ToJson(null,serializationMode) : null, "queryAnalysisValidationResult" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationId.ToString()) : null, "migrationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceDatabaseName.ToString()) : null, "sourceDatabaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.PowerShell.cs new file mode 100644 index 000000000000..aa1a7d246880 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.PowerShell.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration Validation Database level summary result + [System.ComponentModel.TypeConverter(typeof(MigrationValidationDatabaseSummaryResultTypeConverter))] + public partial class MigrationValidationDatabaseSummaryResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationValidationDatabaseSummaryResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationValidationDatabaseSummaryResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationValidationDatabaseSummaryResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationValidationDatabaseSummaryResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SourceDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).SourceDatabaseName = (string) content.GetValueForProperty("SourceDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).SourceDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration Validation Database level summary result + [System.ComponentModel.TypeConverter(typeof(MigrationValidationDatabaseSummaryResultTypeConverter))] + public partial interface IMigrationValidationDatabaseSummaryResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.TypeConverter.cs new file mode 100644 index 000000000000..c192da6f7f04 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationValidationDatabaseSummaryResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationValidationDatabaseSummaryResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationValidationDatabaseSummaryResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationValidationDatabaseSummaryResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.cs new file mode 100644 index 000000000000..052d31781923 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Validation Database level summary result + public partial class MigrationValidationDatabaseSummaryResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal + { + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Validation end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for MigrationId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal.MigrationId { get => this._migrationId; set { {_migrationId = value;} } } + + /// Internal Acessors for SourceDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal.SourceDatabaseName { get => this._sourceDatabaseName; set { {_sourceDatabaseName = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TargetDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResultInternal.TargetDatabaseName { get => this._targetDatabaseName; set { {_targetDatabaseName = value;} } } + + /// Backing field for property. + private string _migrationId; + + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationId { get => this._migrationId; } + + /// Backing field for property. + private string _sourceDatabaseName; + + /// Name of the source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceDatabaseName { get => this._sourceDatabaseName; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Validation start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? _status; + + /// Current status of validation at the database level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get => this._status; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// Name of the target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; } + + /// + /// Creates an new instance. + /// + public MigrationValidationDatabaseSummaryResult() + { + + } + } + /// Migration Validation Database level summary result + public partial interface IMigrationValidationDatabaseSummaryResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Validation end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration Identifier", + SerializedName = @"migrationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationId { get; } + /// Name of the source database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source database", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string SourceDatabaseName { get; } + /// Validation start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current status of validation at the database level + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of validation at the database level", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get; } + /// Name of the target database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the target database", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; } + + } + /// Migration Validation Database level summary result + internal partial interface IMigrationValidationDatabaseSummaryResultInternal + + { + /// Validation end time + global::System.DateTime? EndedOn { get; set; } + /// Result identifier + string Id { get; set; } + /// Migration Identifier + string MigrationId { get; set; } + /// Name of the source database + string SourceDatabaseName { get; set; } + /// Validation start time + global::System.DateTime? StartedOn { get; set; } + /// Current status of validation at the database level + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get; set; } + /// Name of the target database + string TargetDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.json.cs new file mode 100644 index 000000000000..e5dd9955b87f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationDatabaseSummaryResult.json.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Validation Database level summary result + public partial class MigrationValidationDatabaseSummaryResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationValidationDatabaseSummaryResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationValidationDatabaseSummaryResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_migrationId = If( json?.PropertyT("migrationId"), out var __jsonMigrationId) ? (string)__jsonMigrationId : (string)MigrationId;} + {_sourceDatabaseName = If( json?.PropertyT("sourceDatabaseName"), out var __jsonSourceDatabaseName) ? (string)__jsonSourceDatabaseName : (string)SourceDatabaseName;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationId.ToString()) : null, "migrationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceDatabaseName.ToString()) : null, "sourceDatabaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.PowerShell.cs new file mode 100644 index 000000000000..6be57cb56021 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Types of validations to run after the migration + [System.ComponentModel.TypeConverter(typeof(MigrationValidationOptionsTypeConverter))] + public partial class MigrationValidationOptions + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationValidationOptions(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationValidationOptions(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationValidationOptions(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EnableSchemaValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableSchemaValidation = (bool?) content.GetValueForProperty("EnableSchemaValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableSchemaValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableDataIntegrityValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableDataIntegrityValidation = (bool?) content.GetValueForProperty("EnableDataIntegrityValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableDataIntegrityValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableQueryAnalysisValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableQueryAnalysisValidation = (bool?) content.GetValueForProperty("EnableQueryAnalysisValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableQueryAnalysisValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationValidationOptions(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EnableSchemaValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableSchemaValidation = (bool?) content.GetValueForProperty("EnableSchemaValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableSchemaValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableDataIntegrityValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableDataIntegrityValidation = (bool?) content.GetValueForProperty("EnableDataIntegrityValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableDataIntegrityValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableQueryAnalysisValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableQueryAnalysisValidation = (bool?) content.GetValueForProperty("EnableQueryAnalysisValidation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal)this).EnableQueryAnalysisValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Types of validations to run after the migration + [System.ComponentModel.TypeConverter(typeof(MigrationValidationOptionsTypeConverter))] + public partial interface IMigrationValidationOptions + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.TypeConverter.cs new file mode 100644 index 000000000000..2b765c771048 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationValidationOptionsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationValidationOptions.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationValidationOptions.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationValidationOptions.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.cs new file mode 100644 index 000000000000..ab2586419f6c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Types of validations to run after the migration + public partial class MigrationValidationOptions : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptionsInternal + { + + /// Backing field for property. + private bool? _enableDataIntegrityValidation; + + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EnableDataIntegrityValidation { get => this._enableDataIntegrityValidation; set => this._enableDataIntegrityValidation = value; } + + /// Backing field for property. + private bool? _enableQueryAnalysisValidation; + + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EnableQueryAnalysisValidation { get => this._enableQueryAnalysisValidation; set => this._enableQueryAnalysisValidation = value; } + + /// Backing field for property. + private bool? _enableSchemaValidation; + + /// Allows to compare the schema information between source and target. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EnableSchemaValidation { get => this._enableSchemaValidation; set => this._enableSchemaValidation = value; } + + /// Creates an new instance. + public MigrationValidationOptions() + { + + } + } + /// Types of validations to run after the migration + public partial interface IMigrationValidationOptions : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to perform a checksum based data integrity validation between source and target for the selected database / tables .", + SerializedName = @"enableDataIntegrityValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableDataIntegrityValidation { get; set; } + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries.", + SerializedName = @"enableQueryAnalysisValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableQueryAnalysisValidation { get; set; } + /// Allows to compare the schema information between source and target. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to compare the schema information between source and target.", + SerializedName = @"enableSchemaValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableSchemaValidation { get; set; } + + } + /// Types of validations to run after the migration + internal partial interface IMigrationValidationOptionsInternal + + { + /// + /// Allows to perform a checksum based data integrity validation between source and target for the selected database / tables + /// . + /// + bool? EnableDataIntegrityValidation { get; set; } + /// + /// Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them + /// in the target. The result will have execution statistics for executions in source and target databases for the extracted + /// queries. + /// + bool? EnableQueryAnalysisValidation { get; set; } + /// Allows to compare the schema information between source and target. + bool? EnableSchemaValidation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.json.cs new file mode 100644 index 000000000000..b4da68cc957a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationOptions.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Types of validations to run after the migration + public partial class MigrationValidationOptions + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationOptions FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationValidationOptions(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationValidationOptions(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enableSchemaValidation = If( json?.PropertyT("enableSchemaValidation"), out var __jsonEnableSchemaValidation) ? (bool?)__jsonEnableSchemaValidation : EnableSchemaValidation;} + {_enableDataIntegrityValidation = If( json?.PropertyT("enableDataIntegrityValidation"), out var __jsonEnableDataIntegrityValidation) ? (bool?)__jsonEnableDataIntegrityValidation : EnableDataIntegrityValidation;} + {_enableQueryAnalysisValidation = If( json?.PropertyT("enableQueryAnalysisValidation"), out var __jsonEnableQueryAnalysisValidation) ? (bool?)__jsonEnableQueryAnalysisValidation : EnableQueryAnalysisValidation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enableSchemaValidation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._enableSchemaValidation) : null, "enableSchemaValidation" ,container.Add ); + AddIf( null != this._enableDataIntegrityValidation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._enableDataIntegrityValidation) : null, "enableDataIntegrityValidation" ,container.Add ); + AddIf( null != this._enableQueryAnalysisValidation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._enableQueryAnalysisValidation) : null, "enableQueryAnalysisValidation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.PowerShell.cs new file mode 100644 index 000000000000..ad60f40f1aa2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Migration Validation Result + [System.ComponentModel.TypeConverter(typeof(MigrationValidationResultTypeConverter))] + public partial class MigrationValidationResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationValidationResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationValidationResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationValidationResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SummaryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) content.GetValueForProperty("SummaryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResultsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationValidationResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId = (string) content.GetValueForProperty("MigrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).MigrationId, global::System.Convert.ToString); + } + if (content.Contains("SummaryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) content.GetValueForProperty("SummaryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).SummaryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResultsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Migration Validation Result + [System.ComponentModel.TypeConverter(typeof(MigrationValidationResultTypeConverter))] + public partial interface IMigrationValidationResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.TypeConverter.cs new file mode 100644 index 000000000000..d345053bf3a0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationValidationResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationValidationResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationValidationResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationValidationResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.cs new file mode 100644 index 000000000000..702025fec998 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Validation Result + public partial class MigrationValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal + { + + /// Internal Acessors for MigrationId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal.MigrationId { get => this._migrationId; set { {_migrationId = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultInternal.Status { get => this._status; set { {_status = value;} } } + + /// Backing field for property. + private string _migrationId; + + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationId { get => this._migrationId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? _status; + + /// + /// Current status of validation at the migration level. Status from the database validation result status will be aggregated + /// here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get => this._status; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults _summaryResult; + + /// Validation summary results for each database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults SummaryResult { get => (this._summaryResult = this._summaryResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResults()); set => this._summaryResult = value; } + + /// Creates an new instance. + public MigrationValidationResult() + { + + } + } + /// Migration Validation Result + public partial interface IMigrationValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Migration Identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration Identifier", + SerializedName = @"migrationId", + PossibleTypes = new [] { typeof(string) })] + string MigrationId { get; } + /// + /// Current status of validation at the migration level. Status from the database validation result status will be aggregated + /// here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of validation at the migration level. Status from the database validation result status will be aggregated here.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get; } + /// Validation summary results for each database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Validation summary results for each database", + SerializedName = @"summaryResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults SummaryResult { get; set; } + + } + /// Migration Validation Result + internal partial interface IMigrationValidationResultInternal + + { + /// Migration Identifier + string MigrationId { get; set; } + /// + /// Current status of validation at the migration level. Status from the database validation result status will be aggregated + /// here. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus? Status { get; set; } + /// Validation summary results for each database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults SummaryResult { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.json.cs new file mode 100644 index 000000000000..e727c1cc25df --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResult.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Migration Validation Result + public partial class MigrationValidationResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationValidationResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MigrationValidationResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_migrationId = If( json?.PropertyT("migrationId"), out var __jsonMigrationId) ? (string)__jsonMigrationId : (string)MigrationId;} + {_summaryResult = If( json?.PropertyT("summaryResults"), out var __jsonSummaryResults) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResults.FromJson(__jsonSummaryResults) : SummaryResult;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationId.ToString()) : null, "migrationId" ,container.Add ); + } + AddIf( null != this._summaryResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._summaryResult.ToJson(null,serializationMode) : null, "summaryResults" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.PowerShell.cs new file mode 100644 index 000000000000..7ea2d5408ae9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Validation summary results for each database + [System.ComponentModel.TypeConverter(typeof(MigrationValidationResultSummaryResultsTypeConverter))] + public partial class MigrationValidationResultSummaryResults + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MigrationValidationResultSummaryResults(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MigrationValidationResultSummaryResults(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MigrationValidationResultSummaryResults(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MigrationValidationResultSummaryResults(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Validation summary results for each database + [System.ComponentModel.TypeConverter(typeof(MigrationValidationResultSummaryResultsTypeConverter))] + public partial interface IMigrationValidationResultSummaryResults + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.TypeConverter.cs new file mode 100644 index 000000000000..976fae92b8ee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MigrationValidationResultSummaryResultsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MigrationValidationResultSummaryResults.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MigrationValidationResultSummaryResults.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MigrationValidationResultSummaryResults.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.cs new file mode 100644 index 000000000000..ea56f8be7a30 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Validation summary results for each database + public partial class MigrationValidationResultSummaryResults : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResultsInternal + { + + /// Creates an new instance. + public MigrationValidationResultSummaryResults() + { + + } + } + /// Validation summary results for each database + public partial interface IMigrationValidationResultSummaryResults : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Validation summary results for each database + internal partial interface IMigrationValidationResultSummaryResultsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.dictionary.cs new file mode 100644 index 000000000000..ba2806d53a5b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MigrationValidationResultSummaryResults : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationDatabaseSummaryResult value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationResultSummaryResults source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.json.cs new file mode 100644 index 000000000000..edc9f6ee1192 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MigrationValidationResultSummaryResults.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Validation summary results for each database + public partial class MigrationValidationResultSummaryResults + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationValidationResultSummaryResults FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MigrationValidationResultSummaryResults(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MigrationValidationResultSummaryResults(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationValidationDatabaseSummaryResult.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.PowerShell.cs new file mode 100644 index 000000000000..494eb27cbd6f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the command that cancels a migration in whole or in part + [System.ComponentModel.TypeConverter(typeof(MongoDbCancelCommandTypeConverter))] + public partial class MongoDbCancelCommand + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbCancelCommand(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbCancelCommand(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbCancelCommand(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).InputObjectName = (string) content.GetValueForProperty("InputObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).InputObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbCancelCommand(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).InputObjectName = (string) content.GetValueForProperty("InputObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal)this).InputObjectName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the command that cancels a migration in whole or in part + [System.ComponentModel.TypeConverter(typeof(MongoDbCancelCommandTypeConverter))] + public partial interface IMongoDbCancelCommand + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.TypeConverter.cs new file mode 100644 index 000000000000..a152a2a70b1e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbCancelCommandTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbCancelCommand.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbCancelCommand.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbCancelCommand.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.cs new file mode 100644 index 000000000000..bc4d5f52623a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that cancels a migration in whole or in part + public partial class MongoDbCancelCommand : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(); + + /// Command type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType = value ; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput _input; + + /// Command input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput()); set => this._input = value; } + + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)Input).ObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)Input).ObjectName = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommandInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput()); set { {_input = value;} } } + + /// The state of the command. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; } + + /// Creates an new instance. + public MongoDbCancelCommand() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__commandProperties), __commandProperties); + await eventListener.AssertObjectIsValid(nameof(__commandProperties), __commandProperties); + } + } + /// Properties for the command that cancels a migration in whole or in part + public partial interface IMongoDbCancelCommand : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + { + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The qualified name of a database or collection to act upon, or null to act upon the entire migration", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string InputObjectName { get; set; } + + } + /// Properties for the command that cancels a migration in whole or in part + internal partial interface IMongoDbCancelCommandInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal + { + /// Command input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput Input { get; set; } + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + string InputObjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.json.cs new file mode 100644 index 000000000000..9df404eb3834 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCancelCommand.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that cancels a migration in whole or in part + public partial class MongoDbCancelCommand + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCancelCommand FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbCancelCommand(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbCancelCommand(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __commandProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.PowerShell.cs new file mode 100644 index 000000000000..026c40bae5af --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbClusterInfoTypeConverter))] + public partial class MongoDbClusterInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbClusterInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbClusterInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbClusterInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Database = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportsSharding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).SupportsSharding = (bool) content.GetValueForProperty("SupportsSharding",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).SupportsSharding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Version, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbClusterInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Database = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo[]) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Database, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportsSharding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).SupportsSharding = (bool) content.GetValueForProperty("SupportsSharding",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).SupportsSharding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal)this).Version, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbClusterInfoTypeConverter))] + public partial interface IMongoDbClusterInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.TypeConverter.cs new file mode 100644 index 000000000000..547bf734285c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbClusterInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbClusterInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbClusterInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbClusterInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.cs new file mode 100644 index 000000000000..e85c2e48f142 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a MongoDB data source + public partial class MongoDbClusterInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo[] _database; + + /// A list of non-system databases in the cluster + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo[] Database { get => this._database; set => this._database = value; } + + /// Backing field for property. + private bool _supportsSharding; + + /// Whether the cluster supports sharded collections + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool SupportsSharding { get => this._supportsSharding; set => this._supportsSharding = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType _type; + + /// The type of data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private string _version; + + /// + /// The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is BlobContainer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public MongoDbClusterInfo() + { + + } + } + /// Describes a MongoDB data source + public partial interface IMongoDbClusterInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// A list of non-system databases in the cluster + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A list of non-system databases in the cluster", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo[] Database { get; set; } + /// Whether the cluster supports sharded collections + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the cluster supports sharded collections", + SerializedName = @"supportsSharding", + PossibleTypes = new [] { typeof(bool) })] + bool SupportsSharding { get; set; } + /// The type of data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of data source", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType Type { get; set; } + /// + /// The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is BlobContainer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is BlobContainer.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// Describes a MongoDB data source + internal partial interface IMongoDbClusterInfoInternal + + { + /// A list of non-system databases in the cluster + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo[] Database { get; set; } + /// Whether the cluster supports sharded collections + bool SupportsSharding { get; set; } + /// The type of data source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType Type { get; set; } + /// + /// The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is BlobContainer. + /// + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.json.cs new file mode 100644 index 000000000000..6bf6bb5f54a6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbClusterInfo.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a MongoDB data source + public partial class MongoDbClusterInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbClusterInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbClusterInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbClusterInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? If( __jsonDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseInfo.FromJson(__u) )) ))() : null : Database;} + {_supportsSharding = If( json?.PropertyT("supportsSharding"), out var __jsonSupportsSharding) ? (bool)__jsonSupportsSharding : SupportsSharding;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._database) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._database ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("databases",__w); + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._supportsSharding), "supportsSharding" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.PowerShell.cs new file mode 100644 index 000000000000..4243ce148818 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.PowerShell.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a supported collection within a MongoDB database + [System.ComponentModel.TypeConverter(typeof(MongoDbCollectionInfoTypeConverter))] + public partial class MongoDbCollectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbCollectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbCollectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbCollectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShardKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKey = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo) content.GetValueForProperty("ShardKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKey, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyInfoTypeConverter.ConvertFrom); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("IsCapped")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsCapped = (bool) content.GetValueForProperty("IsCapped",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsCapped, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSystemCollection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsSystemCollection = (bool) content.GetValueForProperty("IsSystemCollection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsSystemCollection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsView")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsView = (bool) content.GetValueForProperty("IsView",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsView, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportsSharding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).SupportsSharding = (bool) content.GetValueForProperty("SupportsSharding",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).SupportsSharding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ViewOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ViewOf = (string) content.GetValueForProperty("ViewOf",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ViewOf, global::System.Convert.ToString); + } + if (content.Contains("AverageDocumentSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize = (long) content.GetValueForProperty("AverageDocumentSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize = (long) content.GetValueForProperty("DataSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount = (long) content.GetValueForProperty("DocumentCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ShardKeyField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyField = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("ShardKeyField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyField, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("ShardKeyIsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyIsUnique = (bool) content.GetValueForProperty("ShardKeyIsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyIsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbCollectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShardKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKey = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo) content.GetValueForProperty("ShardKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKey, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyInfoTypeConverter.ConvertFrom); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("IsCapped")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsCapped = (bool) content.GetValueForProperty("IsCapped",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsCapped, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSystemCollection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsSystemCollection = (bool) content.GetValueForProperty("IsSystemCollection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsSystemCollection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsView")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsView = (bool) content.GetValueForProperty("IsView",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).IsView, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportsSharding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).SupportsSharding = (bool) content.GetValueForProperty("SupportsSharding",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).SupportsSharding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ViewOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ViewOf = (string) content.GetValueForProperty("ViewOf",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ViewOf, global::System.Convert.ToString); + } + if (content.Contains("AverageDocumentSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize = (long) content.GetValueForProperty("AverageDocumentSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize = (long) content.GetValueForProperty("DataSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount = (long) content.GetValueForProperty("DocumentCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ShardKeyField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyField = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("ShardKeyField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyField, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("ShardKeyIsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyIsUnique = (bool) content.GetValueForProperty("ShardKeyIsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal)this).ShardKeyIsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a supported collection within a MongoDB database + [System.ComponentModel.TypeConverter(typeof(MongoDbCollectionInfoTypeConverter))] + public partial interface IMongoDbCollectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..0064451cb6d8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbCollectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbCollectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbCollectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbCollectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.cs new file mode 100644 index 000000000000..ccf3b01457d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a supported collection within a MongoDB database + public partial class MongoDbCollectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo __mongoDbObjectInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbObjectInfo(); + + /// The average document size, or -1 if the average size is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long AverageDocumentSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).AverageDocumentSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).AverageDocumentSize = value ; } + + /// The estimated total data size, in bytes, or -1 if the size is unknown. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long DataSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DataSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DataSize = value ; } + + /// Backing field for property. + private string _databaseName; + + /// The name of the database containing the collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// The estimated total number of documents, or -1 if the document count is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long DocumentCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DocumentCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DocumentCount = value ; } + + /// Backing field for property. + private bool _isCapped; + + /// + /// Whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a circular buffer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool IsCapped { get => this._isCapped; set => this._isCapped = value; } + + /// Backing field for property. + private bool _isSystemCollection; + + /// Whether the collection is system collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool IsSystemCollection { get => this._isSystemCollection; set => this._isSystemCollection = value; } + + /// Backing field for property. + private bool _isView; + + /// Whether the collection is a view of another collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool IsView { get => this._isView; set => this._isView = value; } + + /// Internal Acessors for ShardKey + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfoInternal.ShardKey { get => (this._shardKey = this._shardKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyInfo()); set { {_shardKey = value;} } } + + /// The unqualified name of the database or collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).Name = value ; } + + /// + /// The qualified name of the database or collection. For a collection, this is the database-qualified name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string QualifiedName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).QualifiedName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).QualifiedName = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo _shardKey; + + /// The shard key on the collection, or null if the collection is not sharded + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo ShardKey { get => (this._shardKey = this._shardKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyInfo()); set => this._shardKey = value; } + + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] ShardKeyField { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)ShardKey).Field; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)ShardKey).Field = value ?? null /* arrayOf */; } + + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ShardKeyIsUnique { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)ShardKey).IsUnique; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)ShardKey).IsUnique = value ?? default(bool); } + + /// Backing field for property. + private bool _supportsSharding; + + /// + /// Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool SupportsSharding { get => this._supportsSharding; set => this._supportsSharding = value; } + + /// Backing field for property. + private string _viewOf; + + /// The name of the collection that this is a view of, if IsView is true + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ViewOf { get => this._viewOf; set => this._viewOf = value; } + + /// Creates an new instance. + public MongoDbCollectionInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__mongoDbObjectInfo), __mongoDbObjectInfo); + await eventListener.AssertObjectIsValid(nameof(__mongoDbObjectInfo), __mongoDbObjectInfo); + } + } + /// Describes a supported collection within a MongoDB database + public partial interface IMongoDbCollectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo + { + /// The name of the database containing the collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the database containing the collection", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + /// + /// Whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a circular buffer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a circular buffer)", + SerializedName = @"isCapped", + PossibleTypes = new [] { typeof(bool) })] + bool IsCapped { get; set; } + /// Whether the collection is system collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the collection is system collection", + SerializedName = @"isSystemCollection", + PossibleTypes = new [] { typeof(bool) })] + bool IsSystemCollection { get; set; } + /// Whether the collection is a view of another collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the collection is a view of another collection", + SerializedName = @"isView", + PossibleTypes = new [] { typeof(bool) })] + bool IsView { get; set; } + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fields within the shard key", + SerializedName = @"fields", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] ShardKeyField { get; set; } + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the shard key is unique", + SerializedName = @"isUnique", + PossibleTypes = new [] { typeof(bool) })] + bool? ShardKeyIsUnique { get; set; } + /// + /// Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary.", + SerializedName = @"supportsSharding", + PossibleTypes = new [] { typeof(bool) })] + bool SupportsSharding { get; set; } + /// The name of the collection that this is a view of, if IsView is true + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the collection that this is a view of, if IsView is true", + SerializedName = @"viewOf", + PossibleTypes = new [] { typeof(string) })] + string ViewOf { get; set; } + + } + /// Describes a supported collection within a MongoDB database + internal partial interface IMongoDbCollectionInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal + { + /// The name of the database containing the collection + string DatabaseName { get; set; } + /// + /// Whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a circular buffer) + /// + bool IsCapped { get; set; } + /// Whether the collection is system collection + bool IsSystemCollection { get; set; } + /// Whether the collection is a view of another collection + bool IsView { get; set; } + /// The shard key on the collection, or null if the collection is not sharded + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo ShardKey { get; set; } + /// The fields within the shard key + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] ShardKeyField { get; set; } + /// Whether the shard key is unique + bool? ShardKeyIsUnique { get; set; } + /// + /// Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + /// + bool SupportsSharding { get; set; } + /// The name of the collection that this is a view of, if IsView is true + string ViewOf { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.json.cs new file mode 100644 index 000000000000..b3bb683a70e5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionInfo.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a supported collection within a MongoDB database + public partial class MongoDbCollectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbCollectionInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbCollectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __mongoDbObjectInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbObjectInfo(json); + {_shardKey = If( json?.PropertyT("shardKey"), out var __jsonShardKey) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyInfo.FromJson(__jsonShardKey) : ShardKey;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_isCapped = If( json?.PropertyT("isCapped"), out var __jsonIsCapped) ? (bool)__jsonIsCapped : IsCapped;} + {_isSystemCollection = If( json?.PropertyT("isSystemCollection"), out var __jsonIsSystemCollection) ? (bool)__jsonIsSystemCollection : IsSystemCollection;} + {_isView = If( json?.PropertyT("isView"), out var __jsonIsView) ? (bool)__jsonIsView : IsView;} + {_supportsSharding = If( json?.PropertyT("supportsSharding"), out var __jsonSupportsSharding) ? (bool)__jsonSupportsSharding : SupportsSharding;} + {_viewOf = If( json?.PropertyT("viewOf"), out var __jsonViewOf) ? (string)__jsonViewOf : (string)ViewOf;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __mongoDbObjectInfo?.ToJson(container, serializationMode); + AddIf( null != this._shardKey ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._shardKey.ToJson(null,serializationMode) : null, "shardKey" ,container.Add ); + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._isCapped), "isCapped" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._isSystemCollection), "isSystemCollection" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._isView), "isView" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._supportsSharding), "supportsSharding" ,container.Add ); + AddIf( null != (((object)this._viewOf)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._viewOf.ToString()) : null, "viewOf" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.PowerShell.cs new file mode 100644 index 000000000000..f0f6b870715d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.PowerShell.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes the progress of a collection + [System.ComponentModel.TypeConverter(typeof(MongoDbCollectionProgressTypeConverter))] + public partial class MongoDbCollectionProgress + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbCollectionProgress(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbCollectionProgress(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbCollectionProgress(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbCollectionProgress(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the progress of a collection + [System.ComponentModel.TypeConverter(typeof(MongoDbCollectionProgressTypeConverter))] + public partial interface IMongoDbCollectionProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.TypeConverter.cs new file mode 100644 index 000000000000..b881a4bf98a0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbCollectionProgressTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbCollectionProgress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbCollectionProgress.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbCollectionProgress.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.cs new file mode 100644 index 000000000000..50218db783c5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the progress of a collection + public partial class MongoDbCollectionProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgressInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress __mongoDbProgress = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress(); + + /// The number of document bytes copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long BytesCopied { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).BytesCopied; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).BytesCopied = value ; } + + /// The number of documents copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long DocumentsCopied { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).DocumentsCopied; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).DocumentsCopied = value ; } + + /// The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ElapsedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ElapsedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ElapsedTime = value ; } + + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Error = value ; } + + /// The number of oplog events awaiting replay + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long EventsPending { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsPending; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsPending = value ; } + + /// The number of oplog events replayed so far + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long EventsReplayed { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsReplayed; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsReplayed = value ; } + + /// + /// The timestamp of the last oplog event received, or null if no oplog event has been received yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? LastEventTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastEventTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastEventTime = value ?? default(global::System.DateTime); } + + /// + /// The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? LastReplayTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastReplayTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastReplayTime = value ?? default(global::System.DateTime); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Name = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string QualifiedName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).QualifiedName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).QualifiedName = value ?? null; } + + /// The type of progress object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ResultType = value ; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).State = value ; } + + /// + /// The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long TotalByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalByte = value ; } + + /// + /// The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long TotalDocument { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalDocument; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalDocument = value ; } + + /// Creates an new instance. + public MongoDbCollectionProgress() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__mongoDbProgress), __mongoDbProgress); + await eventListener.AssertObjectIsValid(nameof(__mongoDbProgress), __mongoDbProgress); + } + } + /// Describes the progress of a collection + public partial interface IMongoDbCollectionProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress + { + + } + /// Describes the progress of a collection + internal partial interface IMongoDbCollectionProgressInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.json.cs new file mode 100644 index 000000000000..eeff5acddb8d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionProgress.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the progress of a collection + public partial class MongoDbCollectionProgress + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbCollectionProgress(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbCollectionProgress(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __mongoDbProgress = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __mongoDbProgress?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.PowerShell.cs new file mode 100644 index 000000000000..7fdca3f1d075 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes how an individual MongoDB collection should be migrated + [System.ComponentModel.TypeConverter(typeof(MongoDbCollectionSettingsTypeConverter))] + public partial class MongoDbCollectionSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbCollectionSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbCollectionSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbCollectionSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShardKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKey = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting) content.GetValueForProperty("ShardKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKey, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeySettingTypeConverter.ConvertFrom); + } + if (content.Contains("CanDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).CanDelete = (bool?) content.GetValueForProperty("CanDelete",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).CanDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetRUs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).TargetRUs = (int?) content.GetValueForProperty("TargetRUs",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).TargetRUs, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShardKeyField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyField = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("ShardKeyField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyField, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("ShardKeyIsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyIsUnique = (bool?) content.GetValueForProperty("ShardKeyIsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyIsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbCollectionSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShardKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKey = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting) content.GetValueForProperty("ShardKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKey, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeySettingTypeConverter.ConvertFrom); + } + if (content.Contains("CanDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).CanDelete = (bool?) content.GetValueForProperty("CanDelete",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).CanDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetRUs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).TargetRUs = (int?) content.GetValueForProperty("TargetRUs",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).TargetRUs, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShardKeyField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyField = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("ShardKeyField",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyField, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("ShardKeyIsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyIsUnique = (bool?) content.GetValueForProperty("ShardKeyIsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal)this).ShardKeyIsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes how an individual MongoDB collection should be migrated + [System.ComponentModel.TypeConverter(typeof(MongoDbCollectionSettingsTypeConverter))] + public partial interface IMongoDbCollectionSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.TypeConverter.cs new file mode 100644 index 000000000000..086a95b765ef --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbCollectionSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbCollectionSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbCollectionSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbCollectionSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.cs new file mode 100644 index 000000000000..6b890c84d821 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes how an individual MongoDB collection should be migrated + public partial class MongoDbCollectionSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal + { + + /// Backing field for property. + private bool? _canDelete; + + /// + /// Whether the migrator is allowed to drop the target collection in the course of performing a migration. The default is + /// true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? CanDelete { get => this._canDelete; set => this._canDelete = value; } + + /// Internal Acessors for ShardKey + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettingsInternal.ShardKey { get => (this._shardKey = this._shardKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeySetting()); set { {_shardKey = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting _shardKey; + + /// Describes a MongoDB shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting ShardKey { get => (this._shardKey = this._shardKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeySetting()); set => this._shardKey = value; } + + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] ShardKeyField { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)ShardKey).Field; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)ShardKey).Field = value ?? null /* arrayOf */; } + + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? ShardKeyIsUnique { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)ShardKey).IsUnique; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)ShardKey).IsUnique = value ?? default(bool); } + + /// Backing field for property. + private int? _targetRUs; + + /// + /// The RUs that should be configured on a CosmosDB target, or null to use the default. This has no effect on non-CosmosDB + /// targets. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? TargetRUs { get => this._targetRUs; set => this._targetRUs = value; } + + /// Creates an new instance. + public MongoDbCollectionSettings() + { + + } + } + /// Describes how an individual MongoDB collection should be migrated + public partial interface IMongoDbCollectionSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// Whether the migrator is allowed to drop the target collection in the course of performing a migration. The default is + /// true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the migrator is allowed to drop the target collection in the course of performing a migration. The default is true.", + SerializedName = @"canDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? CanDelete { get; set; } + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fields within the shard key", + SerializedName = @"fields", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] ShardKeyField { get; set; } + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the shard key is unique", + SerializedName = @"isUnique", + PossibleTypes = new [] { typeof(bool) })] + bool? ShardKeyIsUnique { get; set; } + /// + /// The RUs that should be configured on a CosmosDB target, or null to use the default. This has no effect on non-CosmosDB + /// targets. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The RUs that should be configured on a CosmosDB target, or null to use the default. This has no effect on non-CosmosDB targets.", + SerializedName = @"targetRUs", + PossibleTypes = new [] { typeof(int) })] + int? TargetRUs { get; set; } + + } + /// Describes how an individual MongoDB collection should be migrated + internal partial interface IMongoDbCollectionSettingsInternal + + { + /// + /// Whether the migrator is allowed to drop the target collection in the course of performing a migration. The default is + /// true. + /// + bool? CanDelete { get; set; } + /// Describes a MongoDB shard key + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting ShardKey { get; set; } + /// The fields within the shard key + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] ShardKeyField { get; set; } + /// Whether the shard key is unique + bool? ShardKeyIsUnique { get; set; } + /// + /// The RUs that should be configured on a CosmosDB target, or null to use the default. This has no effect on non-CosmosDB + /// targets. + /// + int? TargetRUs { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.json.cs new file mode 100644 index 000000000000..eb445b390a72 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCollectionSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes how an individual MongoDB collection should be migrated + public partial class MongoDbCollectionSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbCollectionSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbCollectionSettings(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_shardKey = If( json?.PropertyT("shardKey"), out var __jsonShardKey) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeySetting.FromJson(__jsonShardKey) : ShardKey;} + {_canDelete = If( json?.PropertyT("canDelete"), out var __jsonCanDelete) ? (bool?)__jsonCanDelete : CanDelete;} + {_targetRUs = If( json?.PropertyT("targetRUs"), out var __jsonTargetRUs) ? (int?)__jsonTargetRUs : TargetRUs;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._shardKey ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._shardKey.ToJson(null,serializationMode) : null, "shardKey" ,container.Add ); + AddIf( null != this._canDelete ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._canDelete) : null, "canDelete" ,container.Add ); + AddIf( null != this._targetRUs ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._targetRUs) : null, "targetRUs" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.PowerShell.cs new file mode 100644 index 000000000000..8347278c773a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes the input to the 'cancel' and 'restart' MongoDB migration commands + [System.ComponentModel.TypeConverter(typeof(MongoDbCommandInputTypeConverter))] + public partial class MongoDbCommandInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbCommandInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbCommandInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbCommandInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbCommandInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the input to the 'cancel' and 'restart' MongoDB migration commands + [System.ComponentModel.TypeConverter(typeof(MongoDbCommandInputTypeConverter))] + public partial interface IMongoDbCommandInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.TypeConverter.cs new file mode 100644 index 000000000000..f13127f58e70 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbCommandInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbCommandInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbCommandInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbCommandInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.cs new file mode 100644 index 000000000000..b574a72e1af2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the input to the 'cancel' and 'restart' MongoDB migration commands + public partial class MongoDbCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal + { + + /// Backing field for property. + private string _objectName; + + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ObjectName { get => this._objectName; set => this._objectName = value; } + + /// Creates an new instance. + public MongoDbCommandInput() + { + + } + } + /// Describes the input to the 'cancel' and 'restart' MongoDB migration commands + public partial interface IMongoDbCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The qualified name of a database or collection to act upon, or null to act upon the entire migration", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string ObjectName { get; set; } + + } + /// Describes the input to the 'cancel' and 'restart' MongoDB migration commands + internal partial interface IMongoDbCommandInputInternal + + { + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + string ObjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.json.cs new file mode 100644 index 000000000000..1a0186bcbde9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbCommandInput.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the input to the 'cancel' and 'restart' MongoDB migration commands + public partial class MongoDbCommandInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbCommandInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbCommandInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectName = If( json?.PropertyT("objectName"), out var __jsonObjectName) ? (string)__jsonObjectName : (string)ObjectName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectName.ToString()) : null, "objectName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.PowerShell.cs new file mode 100644 index 000000000000..f9c44575efbf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.PowerShell.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a connection to a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbConnectionInfoTypeConverter))] + public partial class MongoDbConnectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbConnectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbConnectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbConnectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerBrandVersion = (string) content.GetValueForProperty("ServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EnforceSsl = (bool?) content.GetValueForProperty("EnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbConnectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerBrandVersion = (string) content.GetValueForProperty("ServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EnforceSsl = (bool?) content.GetValueForProperty("EnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).EnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a connection to a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbConnectionInfoTypeConverter))] + public partial interface IMongoDbConnectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..cfeaf654deab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbConnectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbConnectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbConnectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbConnectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.cs new file mode 100644 index 000000000000..03117716ee0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.cs @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a connection to a MongoDB data source + public partial class MongoDbConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(); + + /// Backing field for property. + private string _additionalSetting; + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AdditionalSetting { get => this._additionalSetting; set => this._additionalSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? _authentication; + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get => this._authentication; set => this._authentication = value; } + + /// Backing field for property. + private string _connectionString; + + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ConnectionString { get => this._connectionString; set => this._connectionString = value; } + + /// Backing field for property. + private string _dataSource; + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DataSource { get => this._dataSource; set => this._dataSource = value; } + + /// Backing field for property. + private bool? _encryptConnection; + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EncryptConnection { get => this._encryptConnection; set => this._encryptConnection = value; } + + /// Backing field for property. + private bool? _enforceSsl; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EnforceSsl { get => this._enforceSsl; set => this._enforceSsl = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password = value ?? null; } + + /// Backing field for property. + private int? _port; + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Port { get => this._port; set => this._port = value; } + + /// Backing field for property. + private string _serverBrandVersion; + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerBrandVersion { get => this._serverBrandVersion; set => this._serverBrandVersion = value; } + + /// Backing field for property. + private string _serverName; + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Backing field for property. + private string _serverVersion; + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; set => this._serverVersion = value; } + + /// Backing field for property. + private bool? _trustServerCertificate; + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? TrustServerCertificate { get => this._trustServerCertificate; set => this._trustServerCertificate = value; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public MongoDbConnectionInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectionInfo), __connectionInfo); + await eventListener.AssertObjectIsValid(nameof(__connectionInfo), __connectionInfo); + } + } + /// Describes a connection to a MongoDB data source + public partial interface IMongoDbConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName and password properties", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string DataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? EncryptConnection { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"enforceSSL", + PossibleTypes = new [] { typeof(bool) })] + bool? EnforceSsl { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? Port { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TrustServerCertificate { get; set; } + + } + /// Describes a connection to a MongoDB data source + internal partial interface IMongoDbConnectionInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal + { + /// Additional connection settings + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + string ConnectionString { get; set; } + /// Data source + string DataSource { get; set; } + /// Whether to encrypt the connection + bool? EncryptConnection { get; set; } + + bool? EnforceSsl { get; set; } + /// port for server + int? Port { get; set; } + /// server brand version + string ServerBrandVersion { get; set; } + /// name of the server + string ServerName { get; set; } + /// server version + string ServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TrustServerCertificate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.json.cs new file mode 100644 index 000000000000..8dac0b597b29 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbConnectionInfo.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a connection to a MongoDB data source + public partial class MongoDbConnectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbConnectionInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbConnectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(json); + {_connectionString = If( json?.PropertyT("connectionString"), out var __jsonConnectionString) ? (string)__jsonConnectionString : (string)ConnectionString;} + {_dataSource = If( json?.PropertyT("dataSource"), out var __jsonDataSource) ? (string)__jsonDataSource : (string)DataSource;} + {_encryptConnection = If( json?.PropertyT("encryptConnection"), out var __jsonEncryptConnection) ? (bool?)__jsonEncryptConnection : EncryptConnection;} + {_serverBrandVersion = If( json?.PropertyT("serverBrandVersion"), out var __jsonServerBrandVersion) ? (string)__jsonServerBrandVersion : (string)ServerBrandVersion;} + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_trustServerCertificate = If( json?.PropertyT("trustServerCertificate"), out var __jsonTrustServerCertificate) ? (bool?)__jsonTrustServerCertificate : TrustServerCertificate;} + {_enforceSsl = If( json?.PropertyT("enforceSSL"), out var __jsonEnforceSsl) ? (bool?)__jsonEnforceSsl : EnforceSsl;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int?)__jsonPort : Port;} + {_additionalSetting = If( json?.PropertyT("additionalSettings"), out var __jsonAdditionalSettings) ? (string)__jsonAdditionalSettings : (string)AdditionalSetting;} + {_authentication = If( json?.PropertyT("authentication"), out var __jsonAuthentication) ? (string)__jsonAuthentication : (string)Authentication;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectionInfo?.ToJson(container, serializationMode); + AddIf( null != (((object)this._connectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._connectionString.ToString()) : null, "connectionString" ,container.Add ); + AddIf( null != (((object)this._dataSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataSource.ToString()) : null, "dataSource" ,container.Add ); + AddIf( null != this._encryptConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._encryptConnection) : null, "encryptConnection" ,container.Add ); + AddIf( null != (((object)this._serverBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverBrandVersion.ToString()) : null, "serverBrandVersion" ,container.Add ); + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != this._trustServerCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._trustServerCertificate) : null, "trustServerCertificate" ,container.Add ); + AddIf( null != this._enforceSsl ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._enforceSsl) : null, "enforceSSL" ,container.Add ); + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._port) : null, "port" ,container.Add ); + AddIf( null != (((object)this._additionalSetting)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._additionalSetting.ToString()) : null, "additionalSettings" ,container.Add ); + AddIf( null != (((object)this._authentication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authentication.ToString()) : null, "authentication" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.PowerShell.cs new file mode 100644 index 000000000000..602e1e40a77d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a database within a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseInfoTypeConverter))] + public partial class MongoDbDatabaseInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbDatabaseInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbDatabaseInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbDatabaseInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Collection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).Collection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo[]) content.GetValueForProperty("Collection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).Collection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportsSharding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).SupportsSharding = (bool) content.GetValueForProperty("SupportsSharding",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).SupportsSharding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AverageDocumentSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize = (long) content.GetValueForProperty("AverageDocumentSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize = (long) content.GetValueForProperty("DataSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount = (long) content.GetValueForProperty("DocumentCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbDatabaseInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Collection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).Collection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo[]) content.GetValueForProperty("Collection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).Collection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportsSharding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).SupportsSharding = (bool) content.GetValueForProperty("SupportsSharding",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal)this).SupportsSharding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AverageDocumentSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize = (long) content.GetValueForProperty("AverageDocumentSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize = (long) content.GetValueForProperty("DataSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount = (long) content.GetValueForProperty("DocumentCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a database within a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseInfoTypeConverter))] + public partial interface IMongoDbDatabaseInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.TypeConverter.cs new file mode 100644 index 000000000000..5e47b1fe036c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbDatabaseInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbDatabaseInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbDatabaseInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbDatabaseInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.cs new file mode 100644 index 000000000000..7db0d97bcee6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a database within a MongoDB data source + public partial class MongoDbDatabaseInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo __mongoDbObjectInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbObjectInfo(); + + /// The average document size, or -1 if the average size is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long AverageDocumentSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).AverageDocumentSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).AverageDocumentSize = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo[] _collection; + + /// A list of supported collections in a MongoDB database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo[] Collection { get => this._collection; set => this._collection = value; } + + /// The estimated total data size, in bytes, or -1 if the size is unknown. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long DataSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DataSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DataSize = value ; } + + /// The estimated total number of documents, or -1 if the document count is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long DocumentCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DocumentCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).DocumentCount = value ; } + + /// The unqualified name of the database or collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).Name = value ; } + + /// + /// The qualified name of the database or collection. For a collection, this is the database-qualified name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string QualifiedName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).QualifiedName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)__mongoDbObjectInfo).QualifiedName = value ; } + + /// Backing field for property. + private bool _supportsSharding; + + /// + /// Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool SupportsSharding { get => this._supportsSharding; set => this._supportsSharding = value; } + + /// Creates an new instance. + public MongoDbDatabaseInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__mongoDbObjectInfo), __mongoDbObjectInfo); + await eventListener.AssertObjectIsValid(nameof(__mongoDbObjectInfo), __mongoDbObjectInfo); + } + } + /// Describes a database within a MongoDB data source + public partial interface IMongoDbDatabaseInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo + { + /// A list of supported collections in a MongoDB database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A list of supported collections in a MongoDB database", + SerializedName = @"collections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo[] Collection { get; set; } + /// + /// Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary.", + SerializedName = @"supportsSharding", + PossibleTypes = new [] { typeof(bool) })] + bool SupportsSharding { get; set; } + + } + /// Describes a database within a MongoDB data source + internal partial interface IMongoDbDatabaseInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal + { + /// A list of supported collections in a MongoDB database + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo[] Collection { get; set; } + /// + /// Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + /// + bool SupportsSharding { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.json.cs new file mode 100644 index 000000000000..d349af59d8b0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a database within a MongoDB data source + public partial class MongoDbDatabaseInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbDatabaseInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbDatabaseInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __mongoDbObjectInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbObjectInfo(json); + {_collection = If( json?.PropertyT("collections"), out var __jsonCollections) ? If( __jsonCollections as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionInfo.FromJson(__u) )) ))() : null : Collection;} + {_supportsSharding = If( json?.PropertyT("supportsSharding"), out var __jsonSupportsSharding) ? (bool)__jsonSupportsSharding : SupportsSharding;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __mongoDbObjectInfo?.ToJson(container, serializationMode); + if (null != this._collection) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._collection ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("collections",__w); + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._supportsSharding), "supportsSharding" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.PowerShell.cs new file mode 100644 index 000000000000..740ee9611677 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.PowerShell.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes the progress of a database + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseProgressTypeConverter))] + public partial class MongoDbDatabaseProgress + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbDatabaseProgress(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbDatabaseProgress(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbDatabaseProgress(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Collection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressInternal)this).Collection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections) content.GetValueForProperty("Collection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressInternal)this).Collection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgressCollectionsTypeConverter.ConvertFrom); + } + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbDatabaseProgress(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Collection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressInternal)this).Collection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections) content.GetValueForProperty("Collection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressInternal)this).Collection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgressCollectionsTypeConverter.ConvertFrom); + } + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the progress of a database + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseProgressTypeConverter))] + public partial interface IMongoDbDatabaseProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.TypeConverter.cs new file mode 100644 index 000000000000..073b376e5e0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbDatabaseProgressTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbDatabaseProgress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbDatabaseProgress.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbDatabaseProgress.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.cs new file mode 100644 index 000000000000..0b8cfbe39522 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the progress of a database + public partial class MongoDbDatabaseProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress __mongoDbProgress = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress(); + + /// The number of document bytes copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long BytesCopied { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).BytesCopied; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).BytesCopied = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections _collection; + + /// + /// The progress of the collections in the database. The keys are the unqualified names of the collections + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections Collection { get => (this._collection = this._collection ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgressCollections()); set => this._collection = value; } + + /// The number of documents copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long DocumentsCopied { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).DocumentsCopied; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).DocumentsCopied = value ; } + + /// The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ElapsedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ElapsedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ElapsedTime = value ; } + + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Error = value ; } + + /// The number of oplog events awaiting replay + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long EventsPending { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsPending; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsPending = value ; } + + /// The number of oplog events replayed so far + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long EventsReplayed { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsReplayed; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsReplayed = value ; } + + /// + /// The timestamp of the last oplog event received, or null if no oplog event has been received yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? LastEventTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastEventTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastEventTime = value ?? default(global::System.DateTime); } + + /// + /// The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? LastReplayTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastReplayTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastReplayTime = value ?? default(global::System.DateTime); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Name = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string QualifiedName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).QualifiedName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).QualifiedName = value ?? null; } + + /// The type of progress object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ResultType = value ; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).State = value ; } + + /// + /// The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long TotalByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalByte = value ; } + + /// + /// The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long TotalDocument { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalDocument; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalDocument = value ; } + + /// Creates an new instance. + public MongoDbDatabaseProgress() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__mongoDbProgress), __mongoDbProgress); + await eventListener.AssertObjectIsValid(nameof(__mongoDbProgress), __mongoDbProgress); + } + } + /// Describes the progress of a database + public partial interface IMongoDbDatabaseProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress + { + /// + /// The progress of the collections in the database. The keys are the unqualified names of the collections + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The progress of the collections in the database. The keys are the unqualified names of the collections", + SerializedName = @"collections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections Collection { get; set; } + + } + /// Describes the progress of a database + internal partial interface IMongoDbDatabaseProgressInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal + { + /// + /// The progress of the collections in the database. The keys are the unqualified names of the collections + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections Collection { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.json.cs new file mode 100644 index 000000000000..7dea11cd1867 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgress.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the progress of a database + public partial class MongoDbDatabaseProgress + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbDatabaseProgress(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbDatabaseProgress(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __mongoDbProgress = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress(json); + {_collection = If( json?.PropertyT("collections"), out var __jsonCollections) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgressCollections.FromJson(__jsonCollections) : Collection;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __mongoDbProgress?.ToJson(container, serializationMode); + AddIf( null != this._collection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._collection.ToJson(null,serializationMode) : null, "collections" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.PowerShell.cs new file mode 100644 index 000000000000..6a1683364c96 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// The progress of the collections in the database. The keys are the unqualified names of the collections + /// + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseProgressCollectionsTypeConverter))] + public partial class MongoDbDatabaseProgressCollections + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbDatabaseProgressCollections(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbDatabaseProgressCollections(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbDatabaseProgressCollections(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbDatabaseProgressCollections(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The progress of the collections in the database. The keys are the unqualified names of the collections + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseProgressCollectionsTypeConverter))] + public partial interface IMongoDbDatabaseProgressCollections + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.TypeConverter.cs new file mode 100644 index 000000000000..e9149515cfbb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbDatabaseProgressCollectionsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbDatabaseProgressCollections.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbDatabaseProgressCollections.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbDatabaseProgressCollections.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.cs new file mode 100644 index 000000000000..7c8f8de18d95 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The progress of the collections in the database. The keys are the unqualified names of the collections + /// + public partial class MongoDbDatabaseProgressCollections : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollectionsInternal + { + + /// Creates an new instance. + public MongoDbDatabaseProgressCollections() + { + + } + } + /// The progress of the collections in the database. The keys are the unqualified names of the collections + public partial interface IMongoDbDatabaseProgressCollections : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// The progress of the collections in the database. The keys are the unqualified names of the collections + internal partial interface IMongoDbDatabaseProgressCollectionsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.dictionary.cs new file mode 100644 index 000000000000..bc7ca3bb49e5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MongoDbDatabaseProgressCollections : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgressCollections source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.json.cs new file mode 100644 index 000000000000..afa166361659 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseProgressCollections.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The progress of the collections in the database. The keys are the unqualified names of the collections + /// + public partial class MongoDbDatabaseProgressCollections + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgressCollections FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbDatabaseProgressCollections(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MongoDbDatabaseProgressCollections(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.PowerShell.cs new file mode 100644 index 000000000000..30364e19f6bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes how an individual MongoDB database should be migrated + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseSettingsTypeConverter))] + public partial class MongoDbDatabaseSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbDatabaseSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbDatabaseSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbDatabaseSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Collection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).Collection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections) content.GetValueForProperty("Collection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).Collection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettingsCollectionsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetRUs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).TargetRUs = (int?) content.GetValueForProperty("TargetRUs",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).TargetRUs, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbDatabaseSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Collection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).Collection = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections) content.GetValueForProperty("Collection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).Collection, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettingsCollectionsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetRUs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).TargetRUs = (int?) content.GetValueForProperty("TargetRUs",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal)this).TargetRUs, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes how an individual MongoDB database should be migrated + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseSettingsTypeConverter))] + public partial interface IMongoDbDatabaseSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.TypeConverter.cs new file mode 100644 index 000000000000..403656876c18 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbDatabaseSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbDatabaseSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbDatabaseSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbDatabaseSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.cs new file mode 100644 index 000000000000..179e278a3671 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes how an individual MongoDB database should be migrated + public partial class MongoDbDatabaseSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections _collection; + + /// + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections Collection { get => (this._collection = this._collection ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettingsCollections()); set => this._collection = value; } + + /// Backing field for property. + private int? _targetRUs; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? TargetRUs { get => this._targetRUs; set => this._targetRUs = value; } + + /// Creates an new instance. + public MongoDbDatabaseSettings() + { + + } + } + /// Describes how an individual MongoDB database should be migrated + public partial interface IMongoDbDatabaseSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The collections on the source database to migrate to the target. The keys are the unqualified names of the collections.", + SerializedName = @"collections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections Collection { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"targetRUs", + PossibleTypes = new [] { typeof(int) })] + int? TargetRUs { get; set; } + + } + /// Describes how an individual MongoDB database should be migrated + internal partial interface IMongoDbDatabaseSettingsInternal + + { + /// + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections Collection { get; set; } + /// + /// 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. + /// + int? TargetRUs { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.json.cs new file mode 100644 index 000000000000..03a78b3c735b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettings.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes how an individual MongoDB database should be migrated + public partial class MongoDbDatabaseSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbDatabaseSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbDatabaseSettings(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_collection = If( json?.PropertyT("collections"), out var __jsonCollections) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettingsCollections.FromJson(__jsonCollections) : Collection;} + {_targetRUs = If( json?.PropertyT("targetRUs"), out var __jsonTargetRUs) ? (int?)__jsonTargetRUs : TargetRUs;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._collection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._collection.ToJson(null,serializationMode) : null, "collections" ,container.Add ); + AddIf( null != this._targetRUs ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._targetRUs) : null, "targetRUs" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.PowerShell.cs new file mode 100644 index 000000000000..31ff31beeffb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + /// + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseSettingsCollectionsTypeConverter))] + public partial class MongoDbDatabaseSettingsCollections + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbDatabaseSettingsCollections(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbDatabaseSettingsCollections(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbDatabaseSettingsCollections(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbDatabaseSettingsCollections(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + [System.ComponentModel.TypeConverter(typeof(MongoDbDatabaseSettingsCollectionsTypeConverter))] + public partial interface IMongoDbDatabaseSettingsCollections + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.TypeConverter.cs new file mode 100644 index 000000000000..6723b365f6fa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbDatabaseSettingsCollectionsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbDatabaseSettingsCollections.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbDatabaseSettingsCollections.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbDatabaseSettingsCollections.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.cs new file mode 100644 index 000000000000..a320b50f767e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + /// + public partial class MongoDbDatabaseSettingsCollections : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollectionsInternal + { + + /// Creates an new instance. + public MongoDbDatabaseSettingsCollections() + { + + } + } + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + public partial interface IMongoDbDatabaseSettingsCollections : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + internal partial interface IMongoDbDatabaseSettingsCollectionsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.dictionary.cs new file mode 100644 index 000000000000..b37f6eda4f0b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MongoDbDatabaseSettingsCollections : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCollectionSettings value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettingsCollections source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.json.cs new file mode 100644 index 000000000000..d401f2be3a0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbDatabaseSettingsCollections.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + /// + public partial class MongoDbDatabaseSettingsCollections + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettingsCollections FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbDatabaseSettingsCollections(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MongoDbDatabaseSettingsCollections(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCollectionSettings.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.PowerShell.cs new file mode 100644 index 000000000000..7f454d93f96a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes an error or warning that occurred during a MongoDB migration + [System.ComponentModel.TypeConverter(typeof(MongoDbErrorTypeConverter))] + public partial class MongoDbError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes an error or warning that occurred during a MongoDB migration + [System.ComponentModel.TypeConverter(typeof(MongoDbErrorTypeConverter))] + public partial interface IMongoDbError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.TypeConverter.cs new file mode 100644 index 000000000000..219a48e4ef65 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.cs new file mode 100644 index 000000000000..5ee4b94fb323 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes an error or warning that occurred during a MongoDB migration + public partial class MongoDbError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbErrorInternal + { + + /// Backing field for property. + private string _code; + + /// The non-localized, machine-readable code that describes the error or warning + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private int? _count; + + /// The number of times the error or warning has occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _message; + + /// The localized, human-readable message that describes the error or warning + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType? _type; + + /// The type of error or warning + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public MongoDbError() + { + + } + } + /// Describes an error or warning that occurred during a MongoDB migration + public partial interface IMongoDbError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The non-localized, machine-readable code that describes the error or warning + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The non-localized, machine-readable code that describes the error or warning", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The number of times the error or warning has occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The number of times the error or warning has occurred", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + /// The localized, human-readable message that describes the error or warning + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized, human-readable message that describes the error or warning", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// The type of error or warning + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of error or warning", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType? Type { get; set; } + + } + /// Describes an error or warning that occurred during a MongoDB migration + internal partial interface IMongoDbErrorInternal + + { + /// The non-localized, machine-readable code that describes the error or warning + string Code { get; set; } + /// The number of times the error or warning has occurred + int? Count { get; set; } + /// The localized, human-readable message that describes the error or warning + string Message { get; set; } + /// The type of error or warning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.json.cs new file mode 100644 index 000000000000..a9327b01839f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbError.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes an error or warning that occurred during a MongoDB migration + public partial class MongoDbError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int?)__jsonCount : Count;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.PowerShell.cs new file mode 100644 index 000000000000..38a524bd6fc7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the command that finishes a migration in whole or in part + [System.ComponentModel.TypeConverter(typeof(MongoDbFinishCommandTypeConverter))] + public partial class MongoDbFinishCommand + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbFinishCommand(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbFinishCommand(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbFinishCommand(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputObjectName = (string) content.GetValueForProperty("InputObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputObjectName, global::System.Convert.ToString); + } + if (content.Contains("InputImmediate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputImmediate = (bool) content.GetValueForProperty("InputImmediate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputImmediate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbFinishCommand(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputObjectName = (string) content.GetValueForProperty("InputObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputObjectName, global::System.Convert.ToString); + } + if (content.Contains("InputImmediate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputImmediate = (bool) content.GetValueForProperty("InputImmediate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal)this).InputImmediate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the command that finishes a migration in whole or in part + [System.ComponentModel.TypeConverter(typeof(MongoDbFinishCommandTypeConverter))] + public partial interface IMongoDbFinishCommand + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.TypeConverter.cs new file mode 100644 index 000000000000..36a19b79449d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbFinishCommandTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbFinishCommand.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbFinishCommand.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbFinishCommand.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.cs new file mode 100644 index 000000000000..533261667ccc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that finishes a migration in whole or in part + public partial class MongoDbFinishCommand : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(); + + /// Command type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType = value ; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput _input; + + /// Command input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommandInput()); set => this._input = value; } + + /// + /// If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying + /// queued events before finishing the replication. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? InputImmediate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInputInternal)Input).Immediate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInputInternal)Input).Immediate = value ?? default(bool); } + + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)Input).ObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)Input).ObjectName = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommandInput()); set { {_input = value;} } } + + /// The state of the command. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; } + + /// Creates an new instance. + public MongoDbFinishCommand() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__commandProperties), __commandProperties); + await eventListener.AssertObjectIsValid(nameof(__commandProperties), __commandProperties); + } + } + /// Properties for the command that finishes a migration in whole or in part + public partial interface IMongoDbFinishCommand : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + { + /// + /// If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying + /// queued events before finishing the replication. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying queued events before finishing the replication.", + SerializedName = @"immediate", + PossibleTypes = new [] { typeof(bool) })] + bool? InputImmediate { get; set; } + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The qualified name of a database or collection to act upon, or null to act upon the entire migration", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string InputObjectName { get; set; } + + } + /// Properties for the command that finishes a migration in whole or in part + internal partial interface IMongoDbFinishCommandInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal + { + /// Command input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput Input { get; set; } + /// + /// If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying + /// queued events before finishing the replication. + /// + bool? InputImmediate { get; set; } + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + string InputObjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.json.cs new file mode 100644 index 000000000000..f7036d579dfa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommand.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that finishes a migration in whole or in part + public partial class MongoDbFinishCommand + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommand FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbFinishCommand(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbFinishCommand(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbFinishCommandInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __commandProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.PowerShell.cs new file mode 100644 index 000000000000..6634a111aef4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes the input to the 'finish' MongoDB migration command + [System.ComponentModel.TypeConverter(typeof(MongoDbFinishCommandInputTypeConverter))] + public partial class MongoDbFinishCommandInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbFinishCommandInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbFinishCommandInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbFinishCommandInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Immediate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInputInternal)this).Immediate = (bool) content.GetValueForProperty("Immediate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInputInternal)this).Immediate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbFinishCommandInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Immediate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInputInternal)this).Immediate = (bool) content.GetValueForProperty("Immediate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInputInternal)this).Immediate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)this).ObjectName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the input to the 'finish' MongoDB migration command + [System.ComponentModel.TypeConverter(typeof(MongoDbFinishCommandInputTypeConverter))] + public partial interface IMongoDbFinishCommandInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.TypeConverter.cs new file mode 100644 index 000000000000..1993e8f388b8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbFinishCommandInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbFinishCommandInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbFinishCommandInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbFinishCommandInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.cs new file mode 100644 index 000000000000..4f1b80fe29d6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the input to the 'finish' MongoDB migration command + public partial class MongoDbFinishCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput __mongoDbCommandInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput(); + + /// Backing field for property. + private bool _immediate; + + /// + /// If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying + /// queued events before finishing the replication. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool Immediate { get => this._immediate; set => this._immediate = value; } + + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)__mongoDbCommandInput).ObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)__mongoDbCommandInput).ObjectName = value ?? null; } + + /// Creates an new instance. + public MongoDbFinishCommandInput() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__mongoDbCommandInput), __mongoDbCommandInput); + await eventListener.AssertObjectIsValid(nameof(__mongoDbCommandInput), __mongoDbCommandInput); + } + } + /// Describes the input to the 'finish' MongoDB migration command + public partial interface IMongoDbFinishCommandInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput + { + /// + /// If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying + /// queued events before finishing the replication. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying queued events before finishing the replication.", + SerializedName = @"immediate", + PossibleTypes = new [] { typeof(bool) })] + bool Immediate { get; set; } + + } + /// Describes the input to the 'finish' MongoDB migration command + internal partial interface IMongoDbFinishCommandInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal + { + /// + /// If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying + /// queued events before finishing the replication. + /// + bool Immediate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.json.cs new file mode 100644 index 000000000000..38fd2110be41 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbFinishCommandInput.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the input to the 'finish' MongoDB migration command + public partial class MongoDbFinishCommandInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbFinishCommandInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbFinishCommandInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbFinishCommandInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __mongoDbCommandInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput(json); + {_immediate = If( json?.PropertyT("immediate"), out var __jsonImmediate) ? (bool)__jsonImmediate : Immediate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __mongoDbCommandInput?.ToJson(container, serializationMode); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._immediate), "immediate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.PowerShell.cs new file mode 100644 index 000000000000..05f45a4ca9ad --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.PowerShell.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes the progress of the overall migration + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationProgressTypeConverter))] + public partial class MongoDbMigrationProgress + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbMigrationProgress(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbMigrationProgress(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbMigrationProgress(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressInternal)this).Database = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressInternal)this).Database, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgressDatabasesTypeConverter.ConvertFrom); + } + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbMigrationProgress(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressInternal)this).Database = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressInternal)this).Database, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgressDatabasesTypeConverter.ConvertFrom); + } + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the progress of the overall migration + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationProgressTypeConverter))] + public partial interface IMongoDbMigrationProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.TypeConverter.cs new file mode 100644 index 000000000000..c07f127faca8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbMigrationProgressTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbMigrationProgress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbMigrationProgress.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbMigrationProgress.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.cs new file mode 100644 index 000000000000..3fe25e69439b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the progress of the overall migration + public partial class MongoDbMigrationProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress __mongoDbProgress = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress(); + + /// The number of document bytes copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long BytesCopied { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).BytesCopied; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).BytesCopied = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases _database; + + /// + /// The progress of the databases in the migration. The keys are the names of the databases + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases Database { get => (this._database = this._database ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgressDatabases()); set => this._database = value; } + + /// The number of documents copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long DocumentsCopied { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).DocumentsCopied; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).DocumentsCopied = value ; } + + /// The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ElapsedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ElapsedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ElapsedTime = value ; } + + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Error = value ; } + + /// The number of oplog events awaiting replay + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long EventsPending { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsPending; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsPending = value ; } + + /// The number of oplog events replayed so far + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long EventsReplayed { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsReplayed; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).EventsReplayed = value ; } + + /// + /// The timestamp of the last oplog event received, or null if no oplog event has been received yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? LastEventTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastEventTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastEventTime = value ?? default(global::System.DateTime); } + + /// + /// The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? LastReplayTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastReplayTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).LastReplayTime = value ?? default(global::System.DateTime); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).Name = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string QualifiedName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).QualifiedName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).QualifiedName = value ?? null; } + + /// The type of progress object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string ResultType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ResultType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).ResultType = value ; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).State = value ; } + + /// + /// The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long TotalByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalByte = value ; } + + /// + /// The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public long TotalDocument { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalDocument; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)__mongoDbProgress).TotalDocument = value ; } + + /// Creates an new instance. + public MongoDbMigrationProgress() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__mongoDbProgress), __mongoDbProgress); + await eventListener.AssertObjectIsValid(nameof(__mongoDbProgress), __mongoDbProgress); + } + } + /// Describes the progress of the overall migration + public partial interface IMongoDbMigrationProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress + { + /// + /// The progress of the databases in the migration. The keys are the names of the databases + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The progress of the databases in the migration. The keys are the names of the databases", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases Database { get; set; } + + } + /// Describes the progress of the overall migration + internal partial interface IMongoDbMigrationProgressInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal + { + /// + /// The progress of the databases in the migration. The keys are the names of the databases + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases Database { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.json.cs new file mode 100644 index 000000000000..536903bf49ce --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgress.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes the progress of the overall migration + public partial class MongoDbMigrationProgress + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbMigrationProgress(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbMigrationProgress(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __mongoDbProgress = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgress(json); + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgressDatabases.FromJson(__jsonDatabases) : Database;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __mongoDbProgress?.ToJson(container, serializationMode); + AddIf( null != this._database ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._database.ToJson(null,serializationMode) : null, "databases" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.PowerShell.cs new file mode 100644 index 000000000000..79b5e66a0d88 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// The progress of the databases in the migration. The keys are the names of the databases + /// + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationProgressDatabasesTypeConverter))] + public partial class MongoDbMigrationProgressDatabases + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbMigrationProgressDatabases(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbMigrationProgressDatabases(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbMigrationProgressDatabases(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbMigrationProgressDatabases(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The progress of the databases in the migration. The keys are the names of the databases + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationProgressDatabasesTypeConverter))] + public partial interface IMongoDbMigrationProgressDatabases + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.TypeConverter.cs new file mode 100644 index 000000000000..674fb4c96478 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbMigrationProgressDatabasesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbMigrationProgressDatabases.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbMigrationProgressDatabases.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbMigrationProgressDatabases.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.cs new file mode 100644 index 000000000000..f3cf813ddddb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The progress of the databases in the migration. The keys are the names of the databases + /// + public partial class MongoDbMigrationProgressDatabases : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabasesInternal + { + + /// Creates an new instance. + public MongoDbMigrationProgressDatabases() + { + + } + } + /// The progress of the databases in the migration. The keys are the names of the databases + public partial interface IMongoDbMigrationProgressDatabases : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// The progress of the databases in the migration. The keys are the names of the databases + internal partial interface IMongoDbMigrationProgressDatabasesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.dictionary.cs new file mode 100644 index 000000000000..3abc00e2d5ae --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MongoDbMigrationProgressDatabases : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseProgress value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgressDatabases source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.json.cs new file mode 100644 index 000000000000..036234af4429 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationProgressDatabases.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The progress of the databases in the migration. The keys are the names of the databases + /// + public partial class MongoDbMigrationProgressDatabases + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgressDatabases FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbMigrationProgressDatabases(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MongoDbMigrationProgressDatabases(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseProgress.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.PowerShell.cs new file mode 100644 index 000000000000..574d2edbf705 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.PowerShell.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes how a MongoDB data migration should be performed + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationSettingsTypeConverter))] + public partial class MongoDbMigrationSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbMigrationSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbMigrationSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbMigrationSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Throttling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Throttling = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings) content.GetValueForProperty("Throttling",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Throttling, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbThrottlingSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("BoostRUs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).BoostRUs = (int?) content.GetValueForProperty("BoostRUs",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).BoostRUs, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Database = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Database, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsDatabasesTypeConverter.ConvertFrom); + } + if (content.Contains("Replication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Replication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication?) content.GetValueForProperty("Replication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Replication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication.CreateFrom); + } + if (content.Contains("SourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceType = (string) content.GetValueForProperty("SourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceType, global::System.Convert.ToString); + } + if (content.Contains("SourceUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceUserName = (string) content.GetValueForProperty("SourceUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceUserName, global::System.Convert.ToString); + } + if (content.Contains("SourcePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePassword = (string) content.GetValueForProperty("SourcePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceConnectionString = (string) content.GetValueForProperty("SourceConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceConnectionString, global::System.Convert.ToString); + } + if (content.Contains("SourceDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceDataSource = (string) content.GetValueForProperty("SourceDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEncryptConnection = (bool?) content.GetValueForProperty("SourceEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceTrustServerCertificate = (bool?) content.GetValueForProperty("SourceTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceEnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEnforceSsl = (bool?) content.GetValueForProperty("SourceEnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourcePort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePort = (int?) content.GetValueForProperty("SourcePort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAdditionalSetting = (string) content.GetValueForProperty("SourceAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetType = (string) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetType, global::System.Convert.ToString); + } + if (content.Contains("TargetUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetUserName = (string) content.GetValueForProperty("TargetUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPassword = (string) content.GetValueForProperty("TargetPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetConnectionString = (string) content.GetValueForProperty("TargetConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetConnectionString, global::System.Convert.ToString); + } + if (content.Contains("TargetDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetDataSource = (string) content.GetValueForProperty("TargetDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEncryptConnection = (bool?) content.GetValueForProperty("TargetEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetTrustServerCertificate = (bool?) content.GetValueForProperty("TargetTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetEnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEnforceSsl = (bool?) content.GetValueForProperty("TargetEnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPort = (int?) content.GetValueForProperty("TargetPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAdditionalSetting = (string) content.GetValueForProperty("TargetAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ThrottlingMinFreeCpu")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeCpu = (int?) content.GetValueForProperty("ThrottlingMinFreeCpu",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeCpu, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ThrottlingMinFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeMemoryMb = (int?) content.GetValueForProperty("ThrottlingMinFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeMemoryMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ThrottlingMaxParallelism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMaxParallelism = (int?) content.GetValueForProperty("ThrottlingMaxParallelism",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMaxParallelism, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbMigrationSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Throttling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Throttling = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings) content.GetValueForProperty("Throttling",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Throttling, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbThrottlingSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("BoostRUs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).BoostRUs = (int?) content.GetValueForProperty("BoostRUs",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).BoostRUs, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Database")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Database = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases) content.GetValueForProperty("Database",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Database, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsDatabasesTypeConverter.ConvertFrom); + } + if (content.Contains("Replication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Replication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication?) content.GetValueForProperty("Replication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).Replication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication.CreateFrom); + } + if (content.Contains("SourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceType = (string) content.GetValueForProperty("SourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceType, global::System.Convert.ToString); + } + if (content.Contains("SourceUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceUserName = (string) content.GetValueForProperty("SourceUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceUserName, global::System.Convert.ToString); + } + if (content.Contains("SourcePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePassword = (string) content.GetValueForProperty("SourcePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceConnectionString = (string) content.GetValueForProperty("SourceConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceConnectionString, global::System.Convert.ToString); + } + if (content.Contains("SourceDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceDataSource = (string) content.GetValueForProperty("SourceDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEncryptConnection = (bool?) content.GetValueForProperty("SourceEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerBrandVersion = (string) content.GetValueForProperty("SourceServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerVersion = (string) content.GetValueForProperty("SourceServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceTrustServerCertificate = (bool?) content.GetValueForProperty("SourceTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceEnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEnforceSsl = (bool?) content.GetValueForProperty("SourceEnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceEnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourcePort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePort = (int?) content.GetValueForProperty("SourcePort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourcePort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAdditionalSetting = (string) content.GetValueForProperty("SourceAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).SourceAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetType = (string) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetType, global::System.Convert.ToString); + } + if (content.Contains("TargetUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetUserName = (string) content.GetValueForProperty("TargetUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPassword = (string) content.GetValueForProperty("TargetPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetConnectionString = (string) content.GetValueForProperty("TargetConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetConnectionString, global::System.Convert.ToString); + } + if (content.Contains("TargetDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetDataSource = (string) content.GetValueForProperty("TargetDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEncryptConnection = (bool?) content.GetValueForProperty("TargetEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerBrandVersion = (string) content.GetValueForProperty("TargetServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerVersion = (string) content.GetValueForProperty("TargetServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetTrustServerCertificate = (bool?) content.GetValueForProperty("TargetTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetEnforceSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEnforceSsl = (bool?) content.GetValueForProperty("TargetEnforceSsl",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetEnforceSsl, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPort = (int?) content.GetValueForProperty("TargetPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAdditionalSetting = (string) content.GetValueForProperty("TargetAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).TargetAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ThrottlingMinFreeCpu")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeCpu = (int?) content.GetValueForProperty("ThrottlingMinFreeCpu",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeCpu, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ThrottlingMinFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeMemoryMb = (int?) content.GetValueForProperty("ThrottlingMinFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMinFreeMemoryMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ThrottlingMaxParallelism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMaxParallelism = (int?) content.GetValueForProperty("ThrottlingMaxParallelism",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal)this).ThrottlingMaxParallelism, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes how a MongoDB data migration should be performed + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationSettingsTypeConverter))] + public partial interface IMongoDbMigrationSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.TypeConverter.cs new file mode 100644 index 000000000000..3c26ccdaa9c5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbMigrationSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbMigrationSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbMigrationSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbMigrationSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.cs new file mode 100644 index 000000000000..03028a8d15cd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.cs @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes how a MongoDB data migration should be performed + public partial class MongoDbMigrationSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal + { + + /// Backing field for property. + private int? _boostRUs; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? BoostRUs { get => this._boostRUs; set => this._boostRUs = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases _database; + + /// + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases Database { get => (this._database = this._database ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsDatabases()); set => this._database = value; } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal.Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo()); set { {_source = value;} } } + + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal.Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo()); set { {_target = value;} } } + + /// Internal Acessors for Throttling + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsInternal.Throttling { get => (this._throttling = this._throttling ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbThrottlingSettings()); set { {_throttling = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication? _replication; + + /// + /// Describes how changes will be replicated from the source to the target. The default is OneTime. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication? Replication { get => this._replication; set => this._replication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo _source; + + /// Settings used to connect to the source cluster + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo()); set => this._source = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ConnectionString = value ; } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).EncryptConnection = value ?? default(bool); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceEnforceSsl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).EnforceSsl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).EnforceSsl = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourcePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Source).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Source).Password = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourcePort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).Port = value ?? default(int); } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Source).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Source).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Source).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Source).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Source).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo _target; + + /// Settings used to connect to the target cluster + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo()); set => this._target = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ConnectionString = value ; } + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).DataSource = value ?? null; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).EncryptConnection = value ?? default(bool); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetEnforceSsl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).EnforceSsl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).EnforceSsl = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Target).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Target).Password = value ?? null; } + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).Port = value ?? default(int); } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfoInternal)Target).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Target).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Target).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Target).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)Target).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings _throttling; + + /// Settings used to limit the resource usage of the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings Throttling { get => (this._throttling = this._throttling ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbThrottlingSettings()); set => this._throttling = value; } + + /// + /// The maximum number of work items (e.g. collection copies) that will be processed in parallel + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ThrottlingMaxParallelism { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)Throttling).MaxParallelism; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)Throttling).MaxParallelism = value ?? default(int); } + + /// + /// The percentage of CPU time that the migrator will try to avoid using, from 0 to 100 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ThrottlingMinFreeCpu { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)Throttling).MinFreeCpu; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)Throttling).MinFreeCpu = value ?? default(int); } + + /// The number of megabytes of RAM that the migrator will try to avoid using + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? ThrottlingMinFreeMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)Throttling).MinFreeMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)Throttling).MinFreeMemoryMb = value ?? default(int); } + + /// Creates an new instance. + public MongoDbMigrationSettings() + { + + } + } + /// Describes how a MongoDB data migration should be performed + public partial interface IMongoDbMigrationSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"boostRUs", + PossibleTypes = new [] { typeof(int) })] + int? BoostRUs { get; set; } + /// + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The databases on the source cluster to migrate to the target. The keys are the names of the databases.", + SerializedName = @"databases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases Database { get; set; } + /// + /// Describes how changes will be replicated from the source to the target. The default is OneTime. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes how changes will be replicated from the source to the target. The default is OneTime.", + SerializedName = @"replication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication? Replication { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceAuthentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName and password properties", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionString { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceEncryptConnection { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"enforceSSL", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceEnforceSsl { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourcePassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourcePort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetAuthentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName and password properties", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionString { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetEncryptConnection { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"enforceSSL", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetEnforceSsl { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetPassword { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetPort { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetUserName { get; set; } + /// + /// The maximum number of work items (e.g. collection copies) that will be processed in parallel + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of work items (e.g. collection copies) that will be processed in parallel", + SerializedName = @"maxParallelism", + PossibleTypes = new [] { typeof(int) })] + int? ThrottlingMaxParallelism { get; set; } + /// + /// The percentage of CPU time that the migrator will try to avoid using, from 0 to 100 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The percentage of CPU time that the migrator will try to avoid using, from 0 to 100", + SerializedName = @"minFreeCpu", + PossibleTypes = new [] { typeof(int) })] + int? ThrottlingMinFreeCpu { get; set; } + /// The number of megabytes of RAM that the migrator will try to avoid using + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The number of megabytes of RAM that the migrator will try to avoid using", + SerializedName = @"minFreeMemoryMb", + PossibleTypes = new [] { typeof(int) })] + int? ThrottlingMinFreeMemoryMb { get; set; } + + } + /// Describes how a MongoDB data migration should be performed + internal partial interface IMongoDbMigrationSettingsInternal + + { + /// + /// 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. + /// + int? BoostRUs { get; set; } + /// + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases Database { get; set; } + /// + /// Describes how changes will be replicated from the source to the target. The default is OneTime. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication? Replication { get; set; } + /// Settings used to connect to the source cluster + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Source { get; set; } + /// Additional connection settings + string SourceAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceAuthentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + string SourceConnectionString { get; set; } + /// Data source + string SourceDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceEncryptConnection { get; set; } + + bool? SourceEnforceSsl { get; set; } + /// Password credential. + string SourcePassword { get; set; } + /// port for server + int? SourcePort { get; set; } + /// server brand version + string SourceServerBrandVersion { get; set; } + /// name of the server + string SourceServerName { get; set; } + /// server version + string SourceServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceTrustServerCertificate { get; set; } + /// Type of connection info + string SourceType { get; set; } + /// User name + string SourceUserName { get; set; } + /// Settings used to connect to the target cluster + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbConnectionInfo Target { get; set; } + /// Additional connection settings + string TargetAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetAuthentication { get; set; } + /// + /// A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName + /// and password properties + /// + string TargetConnectionString { get; set; } + /// Data source + string TargetDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetEncryptConnection { get; set; } + + bool? TargetEnforceSsl { get; set; } + /// Password credential. + string TargetPassword { get; set; } + /// port for server + int? TargetPort { get; set; } + /// server brand version + string TargetServerBrandVersion { get; set; } + /// name of the server + string TargetServerName { get; set; } + /// server version + string TargetServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetTrustServerCertificate { get; set; } + /// Type of connection info + string TargetType { get; set; } + /// User name + string TargetUserName { get; set; } + /// Settings used to limit the resource usage of the migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings Throttling { get; set; } + /// + /// The maximum number of work items (e.g. collection copies) that will be processed in parallel + /// + int? ThrottlingMaxParallelism { get; set; } + /// + /// The percentage of CPU time that the migrator will try to avoid using, from 0 to 100 + /// + int? ThrottlingMinFreeCpu { get; set; } + /// The number of megabytes of RAM that the migrator will try to avoid using + int? ThrottlingMinFreeMemoryMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.json.cs new file mode 100644 index 000000000000..a6d0eac6956a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettings.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes how a MongoDB data migration should be performed + public partial class MongoDbMigrationSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbMigrationSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbMigrationSettings(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo.FromJson(__jsonSource) : Source;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbConnectionInfo.FromJson(__jsonTarget) : Target;} + {_throttling = If( json?.PropertyT("throttling"), out var __jsonThrottling) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbThrottlingSettings.FromJson(__jsonThrottling) : Throttling;} + {_boostRUs = If( json?.PropertyT("boostRUs"), out var __jsonBoostRUs) ? (int?)__jsonBoostRUs : BoostRUs;} + {_database = If( json?.PropertyT("databases"), out var __jsonDatabases) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsDatabases.FromJson(__jsonDatabases) : Database;} + {_replication = If( json?.PropertyT("replication"), out var __jsonReplication) ? (string)__jsonReplication : (string)Replication;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._source ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._source.ToJson(null,serializationMode) : null, "source" ,container.Add ); + AddIf( null != this._target ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._target.ToJson(null,serializationMode) : null, "target" ,container.Add ); + AddIf( null != this._throttling ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._throttling.ToJson(null,serializationMode) : null, "throttling" ,container.Add ); + AddIf( null != this._boostRUs ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._boostRUs) : null, "boostRUs" ,container.Add ); + AddIf( null != this._database ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._database.ToJson(null,serializationMode) : null, "databases" ,container.Add ); + AddIf( null != (((object)this._replication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._replication.ToString()) : null, "replication" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.PowerShell.cs new file mode 100644 index 000000000000..4dbedb6ca91e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + /// + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationSettingsDatabasesTypeConverter))] + public partial class MongoDbMigrationSettingsDatabases + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbMigrationSettingsDatabases(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbMigrationSettingsDatabases(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbMigrationSettingsDatabases(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbMigrationSettingsDatabases(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + [System.ComponentModel.TypeConverter(typeof(MongoDbMigrationSettingsDatabasesTypeConverter))] + public partial interface IMongoDbMigrationSettingsDatabases + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.TypeConverter.cs new file mode 100644 index 000000000000..c52423735808 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbMigrationSettingsDatabasesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbMigrationSettingsDatabases.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbMigrationSettingsDatabases.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbMigrationSettingsDatabases.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.cs new file mode 100644 index 000000000000..f8b85c4716b0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + /// + public partial class MongoDbMigrationSettingsDatabases : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabasesInternal + { + + /// Creates an new instance. + public MongoDbMigrationSettingsDatabases() + { + + } + } + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + public partial interface IMongoDbMigrationSettingsDatabases : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + internal partial interface IMongoDbMigrationSettingsDatabasesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.dictionary.cs new file mode 100644 index 000000000000..42795e05f585 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MongoDbMigrationSettingsDatabases : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbDatabaseSettings value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsDatabases source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.json.cs new file mode 100644 index 000000000000..f0081f3c8cdd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbMigrationSettingsDatabases.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The databases on the source cluster to migrate to the target. The keys are the names of the databases. + /// + public partial class MongoDbMigrationSettingsDatabases + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettingsDatabases FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbMigrationSettingsDatabases(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MongoDbMigrationSettingsDatabases(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbDatabaseSettings.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.PowerShell.cs new file mode 100644 index 000000000000..f34088e5995d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a database or collection within a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbObjectInfoTypeConverter))] + public partial class MongoDbObjectInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbObjectInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbObjectInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbObjectInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AverageDocumentSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize = (long) content.GetValueForProperty("AverageDocumentSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize = (long) content.GetValueForProperty("DataSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount = (long) content.GetValueForProperty("DocumentCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbObjectInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AverageDocumentSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize = (long) content.GetValueForProperty("AverageDocumentSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).AverageDocumentSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize = (long) content.GetValueForProperty("DataSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DataSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount = (long) content.GetValueForProperty("DocumentCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).DocumentCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal)this).QualifiedName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a database or collection within a MongoDB data source + [System.ComponentModel.TypeConverter(typeof(MongoDbObjectInfoTypeConverter))] + public partial interface IMongoDbObjectInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.TypeConverter.cs new file mode 100644 index 000000000000..2a83f646de65 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbObjectInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbObjectInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbObjectInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbObjectInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.cs new file mode 100644 index 000000000000..35399b3ad77a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a database or collection within a MongoDB data source + public partial class MongoDbObjectInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfoInternal + { + + /// Backing field for property. + private long _averageDocumentSize; + + /// The average document size, or -1 if the average size is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long AverageDocumentSize { get => this._averageDocumentSize; set => this._averageDocumentSize = value; } + + /// Backing field for property. + private long _dataSize; + + /// The estimated total data size, in bytes, or -1 if the size is unknown. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long DataSize { get => this._dataSize; set => this._dataSize = value; } + + /// Backing field for property. + private long _documentCount; + + /// The estimated total number of documents, or -1 if the document count is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long DocumentCount { get => this._documentCount; set => this._documentCount = value; } + + /// Backing field for property. + private string _name; + + /// The unqualified name of the database or collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _qualifiedName; + + /// + /// The qualified name of the database or collection. For a collection, this is the database-qualified name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string QualifiedName { get => this._qualifiedName; set => this._qualifiedName = value; } + + /// Creates an new instance. + public MongoDbObjectInfo() + { + + } + } + /// Describes a database or collection within a MongoDB data source + public partial interface IMongoDbObjectInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The average document size, or -1 if the average size is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The average document size, or -1 if the average size is unknown", + SerializedName = @"averageDocumentSize", + PossibleTypes = new [] { typeof(long) })] + long AverageDocumentSize { get; set; } + /// The estimated total data size, in bytes, or -1 if the size is unknown. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The estimated total data size, in bytes, or -1 if the size is unknown.", + SerializedName = @"dataSize", + PossibleTypes = new [] { typeof(long) })] + long DataSize { get; set; } + /// The estimated total number of documents, or -1 if the document count is unknown + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The estimated total number of documents, or -1 if the document count is unknown", + SerializedName = @"documentCount", + PossibleTypes = new [] { typeof(long) })] + long DocumentCount { get; set; } + /// The unqualified name of the database or collection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The unqualified name of the database or collection", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// The qualified name of the database or collection. For a collection, this is the database-qualified name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The qualified name of the database or collection. For a collection, this is the database-qualified name.", + SerializedName = @"qualifiedName", + PossibleTypes = new [] { typeof(string) })] + string QualifiedName { get; set; } + + } + /// Describes a database or collection within a MongoDB data source + internal partial interface IMongoDbObjectInfoInternal + + { + /// The average document size, or -1 if the average size is unknown + long AverageDocumentSize { get; set; } + /// The estimated total data size, in bytes, or -1 if the size is unknown. + long DataSize { get; set; } + /// The estimated total number of documents, or -1 if the document count is unknown + long DocumentCount { get; set; } + /// The unqualified name of the database or collection + string Name { get; set; } + /// + /// The qualified name of the database or collection. For a collection, this is the database-qualified name. + /// + string QualifiedName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.json.cs new file mode 100644 index 000000000000..d2da40d5ee1f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbObjectInfo.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a database or collection within a MongoDB data source + public partial class MongoDbObjectInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbObjectInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbObjectInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbObjectInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_averageDocumentSize = If( json?.PropertyT("averageDocumentSize"), out var __jsonAverageDocumentSize) ? (long)__jsonAverageDocumentSize : AverageDocumentSize;} + {_dataSize = If( json?.PropertyT("dataSize"), out var __jsonDataSize) ? (long)__jsonDataSize : DataSize;} + {_documentCount = If( json?.PropertyT("documentCount"), out var __jsonDocumentCount) ? (long)__jsonDocumentCount : DocumentCount;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_qualifiedName = If( json?.PropertyT("qualifiedName"), out var __jsonQualifiedName) ? (string)__jsonQualifiedName : (string)QualifiedName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._averageDocumentSize), "averageDocumentSize" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._dataSize), "dataSize" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._documentCount), "documentCount" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._qualifiedName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._qualifiedName.ToString()) : null, "qualifiedName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.PowerShell.cs new file mode 100644 index 000000000000..a4945c77f0b6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.PowerShell.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Base class for MongoDB migration outputs + [System.ComponentModel.TypeConverter(typeof(MongoDbProgressTypeConverter))] + public partial class MongoDbProgress + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbProgress(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbProgress(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbProgress(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbProgress(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BytesCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied = (long) content.GetValueForProperty("BytesCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).BytesCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DocumentsCopied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied = (long) content.GetValueForProperty("DocumentsCopied",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).DocumentsCopied, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime = (string) content.GetValueForProperty("ElapsedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ElapsedTime, global::System.Convert.ToString); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("EventsPending")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending = (long) content.GetValueForProperty("EventsPending",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsPending, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EventsReplayed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed = (long) content.GetValueForProperty("EventsReplayed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).EventsReplayed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastEventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime = (global::System.DateTime?) content.GetValueForProperty("LastEventTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastEventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastReplayTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime = (global::System.DateTime?) content.GetValueForProperty("LastReplayTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).LastReplayTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("QualifiedName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName = (string) content.GetValueForProperty("QualifiedName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).QualifiedName, global::System.Convert.ToString); + } + if (content.Contains("ResultType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType = (string) content.GetValueForProperty("ResultType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).ResultType, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState.CreateFrom); + } + if (content.Contains("TotalByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte = (long) content.GetValueForProperty("TotalByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalDocument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument = (long) content.GetValueForProperty("TotalDocument",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal)this).TotalDocument, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for MongoDB migration outputs + [System.ComponentModel.TypeConverter(typeof(MongoDbProgressTypeConverter))] + public partial interface IMongoDbProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.TypeConverter.cs new file mode 100644 index 000000000000..cea38c174c2d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbProgressTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbProgress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbProgress.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbProgress.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.cs new file mode 100644 index 000000000000..dabf2e79c1d6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for MongoDB migration outputs + public partial class MongoDbProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressInternal + { + + /// Backing field for property. + private long _bytesCopied; + + /// The number of document bytes copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long BytesCopied { get => this._bytesCopied; set => this._bytesCopied = value; } + + /// Backing field for property. + private long _documentsCopied; + + /// The number of documents copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long DocumentsCopied { get => this._documentsCopied; set => this._documentsCopied = value; } + + /// Backing field for property. + private string _elapsedTime; + + /// The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ElapsedTime { get => this._elapsedTime; set => this._elapsedTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors _error; + + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrors()); set => this._error = value; } + + /// Backing field for property. + private long _eventsPending; + + /// The number of oplog events awaiting replay + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long EventsPending { get => this._eventsPending; set => this._eventsPending = value; } + + /// Backing field for property. + private long _eventsReplayed; + + /// The number of oplog events replayed so far + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long EventsReplayed { get => this._eventsReplayed; set => this._eventsReplayed = value; } + + /// Backing field for property. + private global::System.DateTime? _lastEventTime; + + /// + /// The timestamp of the last oplog event received, or null if no oplog event has been received yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastEventTime { get => this._lastEventTime; set => this._lastEventTime = value; } + + /// Backing field for property. + private global::System.DateTime? _lastReplayTime; + + /// + /// The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastReplayTime { get => this._lastReplayTime; set => this._lastReplayTime = value; } + + /// Backing field for property. + private string _name; + + /// + /// The name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the + /// database name. For the overall migration, this is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _qualifiedName; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string QualifiedName { get => this._qualifiedName; set => this._qualifiedName = value; } + + /// Backing field for property. + private string _resultType; + + /// The type of progress object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResultType { get => this._resultType; set => this._resultType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState _state; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState State { get => this._state; set => this._state = value; } + + /// Backing field for property. + private long _totalByte; + + /// + /// The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long TotalByte { get => this._totalByte; set => this._totalByte = value; } + + /// Backing field for property. + private long _totalDocument; + + /// + /// The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long TotalDocument { get => this._totalDocument; set => this._totalDocument = value; } + + /// Creates an new instance. + public MongoDbProgress() + { + + } + } + /// Base class for MongoDB migration outputs + public partial interface IMongoDbProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The number of document bytes copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The number of document bytes copied during the Copying stage", + SerializedName = @"bytesCopied", + PossibleTypes = new [] { typeof(long) })] + long BytesCopied { get; set; } + /// The number of documents copied during the Copying stage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The number of documents copied during the Copying stage", + SerializedName = @"documentsCopied", + PossibleTypes = new [] { typeof(long) })] + long DocumentsCopied { get; set; } + /// The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format)", + SerializedName = @"elapsedTime", + PossibleTypes = new [] { typeof(string) })] + string ElapsedTime { get; set; } + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The errors and warnings that have occurred for the current object. The keys are the error codes.", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors Error { get; set; } + /// The number of oplog events awaiting replay + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The number of oplog events awaiting replay", + SerializedName = @"eventsPending", + PossibleTypes = new [] { typeof(long) })] + long EventsPending { get; set; } + /// The number of oplog events replayed so far + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The number of oplog events replayed so far", + SerializedName = @"eventsReplayed", + PossibleTypes = new [] { typeof(long) })] + long EventsReplayed { get; set; } + /// + /// The timestamp of the last oplog event received, or null if no oplog event has been received yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of the last oplog event received, or null if no oplog event has been received yet", + SerializedName = @"lastEventTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastEventTime { get; set; } + /// + /// The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet", + SerializedName = @"lastReplayTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastReplayTime { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"qualifiedName", + PossibleTypes = new [] { typeof(string) })] + string QualifiedName { get; set; } + /// The type of progress object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of progress object", + SerializedName = @"resultType", + PossibleTypes = new [] { typeof(string) })] + string ResultType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState State { get; set; } + /// + /// The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown", + SerializedName = @"totalBytes", + PossibleTypes = new [] { typeof(long) })] + long TotalByte { get; set; } + /// + /// The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown", + SerializedName = @"totalDocuments", + PossibleTypes = new [] { typeof(long) })] + long TotalDocument { get; set; } + + } + /// Base class for MongoDB migration outputs + internal partial interface IMongoDbProgressInternal + + { + /// The number of document bytes copied during the Copying stage + long BytesCopied { get; set; } + /// The number of documents copied during the Copying stage + long DocumentsCopied { get; set; } + /// The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + string ElapsedTime { get; set; } + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors Error { get; set; } + /// The number of oplog events awaiting replay + long EventsPending { get; set; } + /// The number of oplog events replayed so far + long EventsReplayed { get; set; } + /// + /// The timestamp of the last oplog event received, or null if no oplog event has been received yet + /// + global::System.DateTime? LastEventTime { get; set; } + /// + /// The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet + /// + global::System.DateTime? LastReplayTime { get; set; } + /// + /// 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. + /// + string Name { get; set; } + /// + /// 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. + /// + string QualifiedName { get; set; } + /// The type of progress object + string ResultType { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState State { get; set; } + /// + /// The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown + /// + long TotalByte { get; set; } + /// + /// The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown + /// + long TotalDocument { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.json.cs new file mode 100644 index 000000000000..a7e53dae705c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgress.json.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for MongoDB migration outputs + public partial class MongoDbProgress + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("resultType") ) + { + case "Collection": + { + return new MongoDbCollectionProgress(json); + } + case "Database": + { + return new MongoDbDatabaseProgress(json); + } + case "Migration": + { + return new MongoDbMigrationProgress(json); + } + } + return new MongoDbProgress(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbProgress(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_bytesCopied = If( json?.PropertyT("bytesCopied"), out var __jsonBytesCopied) ? (long)__jsonBytesCopied : BytesCopied;} + {_documentsCopied = If( json?.PropertyT("documentsCopied"), out var __jsonDocumentsCopied) ? (long)__jsonDocumentsCopied : DocumentsCopied;} + {_elapsedTime = If( json?.PropertyT("elapsedTime"), out var __jsonElapsedTime) ? (string)__jsonElapsedTime : (string)ElapsedTime;} + {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrors.FromJson(__jsonErrors) : Error;} + {_eventsPending = If( json?.PropertyT("eventsPending"), out var __jsonEventsPending) ? (long)__jsonEventsPending : EventsPending;} + {_eventsReplayed = If( json?.PropertyT("eventsReplayed"), out var __jsonEventsReplayed) ? (long)__jsonEventsReplayed : EventsReplayed;} + {_lastEventTime = If( json?.PropertyT("lastEventTime"), out var __jsonLastEventTime) ? global::System.DateTime.TryParse((string)__jsonLastEventTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastEventTimeValue) ? __jsonLastEventTimeValue : LastEventTime : LastEventTime;} + {_lastReplayTime = If( json?.PropertyT("lastReplayTime"), out var __jsonLastReplayTime) ? global::System.DateTime.TryParse((string)__jsonLastReplayTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastReplayTimeValue) ? __jsonLastReplayTimeValue : LastReplayTime : LastReplayTime;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_qualifiedName = If( json?.PropertyT("qualifiedName"), out var __jsonQualifiedName) ? (string)__jsonQualifiedName : (string)QualifiedName;} + {_resultType = If( json?.PropertyT("resultType"), out var __jsonResultType) ? (string)__jsonResultType : (string)ResultType;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_totalByte = If( json?.PropertyT("totalBytes"), out var __jsonTotalBytes) ? (long)__jsonTotalBytes : TotalByte;} + {_totalDocument = If( json?.PropertyT("totalDocuments"), out var __jsonTotalDocuments) ? (long)__jsonTotalDocuments : TotalDocument;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._bytesCopied), "bytesCopied" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._documentsCopied), "documentsCopied" ,container.Add ); + AddIf( null != (((object)this._elapsedTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._elapsedTime.ToString()) : null, "elapsedTime" ,container.Add ); + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "errors" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._eventsPending), "eventsPending" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._eventsReplayed), "eventsReplayed" ,container.Add ); + AddIf( null != this._lastEventTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastEventTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastEventTime" ,container.Add ); + AddIf( null != this._lastReplayTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastReplayTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastReplayTime" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._qualifiedName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._qualifiedName.ToString()) : null, "qualifiedName" ,container.Add ); + AddIf( null != (((object)this._resultType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultType.ToString()) : null, "resultType" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._totalByte), "totalBytes" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._totalDocument), "totalDocuments" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.PowerShell.cs new file mode 100644 index 000000000000..eb5bf2ab7420 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + [System.ComponentModel.TypeConverter(typeof(MongoDbProgressErrorsTypeConverter))] + public partial class MongoDbProgressErrors + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbProgressErrors(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbProgressErrors(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbProgressErrors(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbProgressErrors(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + [System.ComponentModel.TypeConverter(typeof(MongoDbProgressErrorsTypeConverter))] + public partial interface IMongoDbProgressErrors + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.TypeConverter.cs new file mode 100644 index 000000000000..7148ffa7cb66 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbProgressErrorsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbProgressErrors.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbProgressErrors.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbProgressErrors.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.cs new file mode 100644 index 000000000000..35593e7db0af --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + public partial class MongoDbProgressErrors : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrorsInternal + { + + /// Creates an new instance. + public MongoDbProgressErrors() + { + + } + } + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + public partial interface IMongoDbProgressErrors : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + internal partial interface IMongoDbProgressErrorsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.dictionary.cs new file mode 100644 index 000000000000..023ce435a8f3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class MongoDbProgressErrors : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbError value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbProgressErrors source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.json.cs new file mode 100644 index 000000000000..99b03a4e14a6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbProgressErrors.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// The errors and warnings that have occurred for the current object. The keys are the error codes. + /// + public partial class MongoDbProgressErrors + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbProgressErrors FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbProgressErrors(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MongoDbProgressErrors(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbError.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.PowerShell.cs new file mode 100644 index 000000000000..0e0db2207975 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the command that restarts a migration in whole or in part + [System.ComponentModel.TypeConverter(typeof(MongoDbRestartCommandTypeConverter))] + public partial class MongoDbRestartCommand + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbRestartCommand(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbRestartCommand(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbRestartCommand(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).InputObjectName = (string) content.GetValueForProperty("InputObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).InputObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbRestartCommand(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInputTypeConverter.ConvertFrom); + } + if (content.Contains("CommandType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) content.GetValueForProperty("CommandType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).CommandType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState.CreateFrom); + } + if (content.Contains("InputObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).InputObjectName = (string) content.GetValueForProperty("InputObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal)this).InputObjectName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the command that restarts a migration in whole or in part + [System.ComponentModel.TypeConverter(typeof(MongoDbRestartCommandTypeConverter))] + public partial interface IMongoDbRestartCommand + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.TypeConverter.cs new file mode 100644 index 000000000000..7e3f5b505734 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbRestartCommandTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbRestartCommand.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbRestartCommand.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbRestartCommand.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.cs new file mode 100644 index 000000000000..4aa899daf68d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that restarts a migration in whole or in part + public partial class MongoDbRestartCommand : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(); + + /// Command type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).CommandType = value ; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput _input; + + /// Command input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput()); set => this._input = value; } + + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string InputObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)Input).ObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInputInternal)Input).ObjectName = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommandInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput()); set { {_input = value;} } } + + /// The state of the command. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal)__commandProperties).State; } + + /// Creates an new instance. + public MongoDbRestartCommand() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__commandProperties), __commandProperties); + await eventListener.AssertObjectIsValid(nameof(__commandProperties), __commandProperties); + } + } + /// Properties for the command that restarts a migration in whole or in part + public partial interface IMongoDbRestartCommand : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + { + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The qualified name of a database or collection to act upon, or null to act upon the entire migration", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string InputObjectName { get; set; } + + } + /// Properties for the command that restarts a migration in whole or in part + internal partial interface IMongoDbRestartCommandInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandPropertiesInternal + { + /// Command input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbCommandInput Input { get; set; } + /// + /// The qualified name of a database or collection to act upon, or null to act upon the entire migration + /// + string InputObjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.json.cs new file mode 100644 index 000000000000..821759b68d5a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbRestartCommand.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the command that restarts a migration in whole or in part + public partial class MongoDbRestartCommand + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbRestartCommand FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbRestartCommand(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbRestartCommand(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __commandProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbCommandInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __commandProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.PowerShell.cs new file mode 100644 index 000000000000..52a34ab0b9b4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a field reference within a MongoDB shard key + [System.ComponentModel.TypeConverter(typeof(MongoDbShardKeyFieldTypeConverter))] + public partial class MongoDbShardKeyField + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbShardKeyField(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbShardKeyField(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbShardKeyField(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Order")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Order = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder) content.GetValueForProperty("Order",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Order, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbShardKeyField(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Order")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Order = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder) content.GetValueForProperty("Order",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal)this).Order, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a field reference within a MongoDB shard key + [System.ComponentModel.TypeConverter(typeof(MongoDbShardKeyFieldTypeConverter))] + public partial interface IMongoDbShardKeyField + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.TypeConverter.cs new file mode 100644 index 000000000000..69c872b5beb5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbShardKeyFieldTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbShardKeyField.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbShardKeyField.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbShardKeyField.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.cs new file mode 100644 index 000000000000..5c0c1ab7af97 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a field reference within a MongoDB shard key + public partial class MongoDbShardKeyField : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyFieldInternal + { + + /// Backing field for property. + private string _name; + + /// The name of the field + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder _order; + + /// The field ordering + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder Order { get => this._order; set => this._order = value; } + + /// Creates an new instance. + public MongoDbShardKeyField() + { + + } + } + /// Describes a field reference within a MongoDB shard key + public partial interface IMongoDbShardKeyField : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The name of the field + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the field", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The field ordering + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The field ordering", + SerializedName = @"order", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder Order { get; set; } + + } + /// Describes a field reference within a MongoDB shard key + internal partial interface IMongoDbShardKeyFieldInternal + + { + /// The name of the field + string Name { get; set; } + /// The field ordering + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder Order { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.json.cs new file mode 100644 index 000000000000..cb866bcaae4c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyField.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a field reference within a MongoDB shard key + public partial class MongoDbShardKeyField + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbShardKeyField(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbShardKeyField(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_order = If( json?.PropertyT("order"), out var __jsonOrder) ? (string)__jsonOrder : (string)Order;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._order)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._order.ToString()) : null, "order" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.PowerShell.cs new file mode 100644 index 000000000000..7d6b86c36a58 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a MongoDB shard key + [System.ComponentModel.TypeConverter(typeof(MongoDbShardKeyInfoTypeConverter))] + public partial class MongoDbShardKeyInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbShardKeyInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbShardKeyInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbShardKeyInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Field")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).Field = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).Field, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("IsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).IsUnique = (bool) content.GetValueForProperty("IsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).IsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbShardKeyInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Field")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).Field = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).Field, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("IsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).IsUnique = (bool) content.GetValueForProperty("IsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal)this).IsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a MongoDB shard key + [System.ComponentModel.TypeConverter(typeof(MongoDbShardKeyInfoTypeConverter))] + public partial interface IMongoDbShardKeyInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.TypeConverter.cs new file mode 100644 index 000000000000..79415b33fb4b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbShardKeyInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbShardKeyInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbShardKeyInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbShardKeyInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.cs new file mode 100644 index 000000000000..01db866fcc6b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a MongoDB shard key + public partial class MongoDbShardKeyInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] _field; + + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] Field { get => this._field; set => this._field = value; } + + /// Backing field for property. + private bool _isUnique; + + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool IsUnique { get => this._isUnique; set => this._isUnique = value; } + + /// Creates an new instance. + public MongoDbShardKeyInfo() + { + + } + } + /// Describes a MongoDB shard key + public partial interface IMongoDbShardKeyInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The fields within the shard key", + SerializedName = @"fields", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] Field { get; set; } + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the shard key is unique", + SerializedName = @"isUnique", + PossibleTypes = new [] { typeof(bool) })] + bool IsUnique { get; set; } + + } + /// Describes a MongoDB shard key + internal partial interface IMongoDbShardKeyInfoInternal + + { + /// The fields within the shard key + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] Field { get; set; } + /// Whether the shard key is unique + bool IsUnique { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.json.cs new file mode 100644 index 000000000000..4f696b4395e6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeyInfo.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a MongoDB shard key + public partial class MongoDbShardKeyInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbShardKeyInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbShardKeyInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_field = If( json?.PropertyT("fields"), out var __jsonFields) ? If( __jsonFields as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyField.FromJson(__u) )) ))() : null : Field;} + {_isUnique = If( json?.PropertyT("isUnique"), out var __jsonIsUnique) ? (bool)__jsonIsUnique : IsUnique;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._field) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._field ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("fields",__w); + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean(this._isUnique), "isUnique" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.PowerShell.cs new file mode 100644 index 000000000000..f203d2802cba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a MongoDB shard key + [System.ComponentModel.TypeConverter(typeof(MongoDbShardKeySettingTypeConverter))] + public partial class MongoDbShardKeySetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbShardKeySetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbShardKeySetting(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbShardKeySetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Field")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).Field = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).Field, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("IsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).IsUnique = (bool?) content.GetValueForProperty("IsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).IsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbShardKeySetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Field")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).Field = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[]) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).Field, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("IsUnique")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).IsUnique = (bool?) content.GetValueForProperty("IsUnique",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal)this).IsUnique, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a MongoDB shard key + [System.ComponentModel.TypeConverter(typeof(MongoDbShardKeySettingTypeConverter))] + public partial interface IMongoDbShardKeySetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.TypeConverter.cs new file mode 100644 index 000000000000..adb943c4804b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbShardKeySettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbShardKeySetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbShardKeySetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbShardKeySetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.cs new file mode 100644 index 000000000000..f15c0112be49 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a MongoDB shard key + public partial class MongoDbShardKeySetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySettingInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] _field; + + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] Field { get => this._field; set => this._field = value; } + + /// Backing field for property. + private bool? _isUnique; + + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsUnique { get => this._isUnique; set => this._isUnique = value; } + + /// Creates an new instance. + public MongoDbShardKeySetting() + { + + } + } + /// Describes a MongoDB shard key + public partial interface IMongoDbShardKeySetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The fields within the shard key + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The fields within the shard key", + SerializedName = @"fields", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] Field { get; set; } + /// Whether the shard key is unique + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the shard key is unique", + SerializedName = @"isUnique", + PossibleTypes = new [] { typeof(bool) })] + bool? IsUnique { get; set; } + + } + /// Describes a MongoDB shard key + internal partial interface IMongoDbShardKeySettingInternal + + { + /// The fields within the shard key + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField[] Field { get; set; } + /// Whether the shard key is unique + bool? IsUnique { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.json.cs new file mode 100644 index 000000000000..fbff3c7a31f1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbShardKeySetting.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a MongoDB shard key + public partial class MongoDbShardKeySetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeySetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbShardKeySetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbShardKeySetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_field = If( json?.PropertyT("fields"), out var __jsonFields) ? If( __jsonFields as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbShardKeyField) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbShardKeyField.FromJson(__u) )) ))() : null : Field;} + {_isUnique = If( json?.PropertyT("isUnique"), out var __jsonIsUnique) ? (bool?)__jsonIsUnique : IsUnique;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._field) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._field ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("fields",__w); + } + AddIf( null != this._isUnique ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isUnique) : null, "isUnique" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.PowerShell.cs new file mode 100644 index 000000000000..85793a559dab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Specifies resource limits for the migration + [System.ComponentModel.TypeConverter(typeof(MongoDbThrottlingSettingsTypeConverter))] + public partial class MongoDbThrottlingSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MongoDbThrottlingSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MongoDbThrottlingSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MongoDbThrottlingSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MinFreeCpu")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeCpu = (int?) content.GetValueForProperty("MinFreeCpu",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeCpu, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeMemoryMb = (int?) content.GetValueForProperty("MinFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeMemoryMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaxParallelism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MaxParallelism = (int?) content.GetValueForProperty("MaxParallelism",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MaxParallelism, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MongoDbThrottlingSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MinFreeCpu")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeCpu = (int?) content.GetValueForProperty("MinFreeCpu",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeCpu, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeMemoryMb = (int?) content.GetValueForProperty("MinFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MinFreeMemoryMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaxParallelism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MaxParallelism = (int?) content.GetValueForProperty("MaxParallelism",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal)this).MaxParallelism, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Specifies resource limits for the migration + [System.ComponentModel.TypeConverter(typeof(MongoDbThrottlingSettingsTypeConverter))] + public partial interface IMongoDbThrottlingSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.TypeConverter.cs new file mode 100644 index 000000000000..81e570809d15 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MongoDbThrottlingSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MongoDbThrottlingSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MongoDbThrottlingSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MongoDbThrottlingSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.cs new file mode 100644 index 000000000000..5f48d2af4d9b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Specifies resource limits for the migration + public partial class MongoDbThrottlingSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettingsInternal + { + + /// Backing field for property. + private int? _maxParallelism; + + /// + /// The maximum number of work items (e.g. collection copies) that will be processed in parallel + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? MaxParallelism { get => this._maxParallelism; set => this._maxParallelism = value; } + + /// Backing field for property. + private int? _minFreeCpu; + + /// + /// The percentage of CPU time that the migrator will try to avoid using, from 0 to 100 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? MinFreeCpu { get => this._minFreeCpu; set => this._minFreeCpu = value; } + + /// Backing field for property. + private int? _minFreeMemoryMb; + + /// The number of megabytes of RAM that the migrator will try to avoid using + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? MinFreeMemoryMb { get => this._minFreeMemoryMb; set => this._minFreeMemoryMb = value; } + + /// Creates an new instance. + public MongoDbThrottlingSettings() + { + + } + } + /// Specifies resource limits for the migration + public partial interface IMongoDbThrottlingSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// The maximum number of work items (e.g. collection copies) that will be processed in parallel + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of work items (e.g. collection copies) that will be processed in parallel", + SerializedName = @"maxParallelism", + PossibleTypes = new [] { typeof(int) })] + int? MaxParallelism { get; set; } + /// + /// The percentage of CPU time that the migrator will try to avoid using, from 0 to 100 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The percentage of CPU time that the migrator will try to avoid using, from 0 to 100", + SerializedName = @"minFreeCpu", + PossibleTypes = new [] { typeof(int) })] + int? MinFreeCpu { get; set; } + /// The number of megabytes of RAM that the migrator will try to avoid using + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The number of megabytes of RAM that the migrator will try to avoid using", + SerializedName = @"minFreeMemoryMb", + PossibleTypes = new [] { typeof(int) })] + int? MinFreeMemoryMb { get; set; } + + } + /// Specifies resource limits for the migration + internal partial interface IMongoDbThrottlingSettingsInternal + + { + /// + /// The maximum number of work items (e.g. collection copies) that will be processed in parallel + /// + int? MaxParallelism { get; set; } + /// + /// The percentage of CPU time that the migrator will try to avoid using, from 0 to 100 + /// + int? MinFreeCpu { get; set; } + /// The number of megabytes of RAM that the migrator will try to avoid using + int? MinFreeMemoryMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.json.cs new file mode 100644 index 000000000000..fe779b40b16b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MongoDbThrottlingSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Specifies resource limits for the migration + public partial class MongoDbThrottlingSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbThrottlingSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MongoDbThrottlingSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MongoDbThrottlingSettings(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_minFreeCpu = If( json?.PropertyT("minFreeCpu"), out var __jsonMinFreeCpu) ? (int?)__jsonMinFreeCpu : MinFreeCpu;} + {_minFreeMemoryMb = If( json?.PropertyT("minFreeMemoryMb"), out var __jsonMinFreeMemoryMb) ? (int?)__jsonMinFreeMemoryMb : MinFreeMemoryMb;} + {_maxParallelism = If( json?.PropertyT("maxParallelism"), out var __jsonMaxParallelism) ? (int?)__jsonMaxParallelism : MaxParallelism;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._minFreeCpu ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._minFreeCpu) : null, "minFreeCpu" ,container.Add ); + AddIf( null != this._minFreeMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._minFreeMemoryMb) : null, "minFreeMemoryMb" ,container.Add ); + AddIf( null != this._maxParallelism ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._maxParallelism) : null, "maxParallelism" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.PowerShell.cs new file mode 100644 index 000000000000..dbffaab0a1bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information for connecting to MySQL server + [System.ComponentModel.TypeConverter(typeof(MySqlConnectionInfoTypeConverter))] + public partial class MySqlConnectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MySqlConnectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MySqlConnectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MySqlConnectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Port = (int) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MySqlConnectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Port = (int) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information for connecting to MySQL server + [System.ComponentModel.TypeConverter(typeof(MySqlConnectionInfoTypeConverter))] + public partial interface IMySqlConnectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..5df84a3dd154 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MySqlConnectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MySqlConnectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MySqlConnectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MySqlConnectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.cs new file mode 100644 index 000000000000..840ca5474dc8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to MySQL server + public partial class MySqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(); + + /// Backing field for property. + private string _additionalSetting; + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AdditionalSetting { get => this._additionalSetting; set => this._additionalSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? _authentication; + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get => this._authentication; set => this._authentication = value; } + + /// Backing field for property. + private string _dataSource; + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DataSource { get => this._dataSource; set => this._dataSource = value; } + + /// Backing field for property. + private bool? _encryptConnection; + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EncryptConnection { get => this._encryptConnection; set => this._encryptConnection = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password = value ?? null; } + + /// Backing field for property. + private int _port; + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int Port { get => this._port; set => this._port = value; } + + /// Backing field for property. + private string _serverName; + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public MySqlConnectionInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectionInfo), __connectionInfo); + await eventListener.AssertObjectIsValid(nameof(__connectionInfo), __connectionInfo); + } + } + /// Information for connecting to MySQL server + public partial interface IMySqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string DataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? EncryptConnection { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int Port { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + + } + /// Information for connecting to MySQL server + internal partial interface IMySqlConnectionInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal + { + /// Additional connection settings + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// Data source + string DataSource { get; set; } + /// Whether to encrypt the connection + bool? EncryptConnection { get; set; } + /// Port for Server + int Port { get; set; } + /// Name of the server + string ServerName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.json.cs new file mode 100644 index 000000000000..2df68da5f7d8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/MySqlConnectionInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to MySQL server + public partial class MySqlConnectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMySqlConnectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new MySqlConnectionInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal MySqlConnectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(json); + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_dataSource = If( json?.PropertyT("dataSource"), out var __jsonDataSource) ? (string)__jsonDataSource : (string)DataSource;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int)__jsonPort : Port;} + {_encryptConnection = If( json?.PropertyT("encryptConnection"), out var __jsonEncryptConnection) ? (bool?)__jsonEncryptConnection : EncryptConnection;} + {_authentication = If( json?.PropertyT("authentication"), out var __jsonAuthentication) ? (string)__jsonAuthentication : (string)Authentication;} + {_additionalSetting = If( json?.PropertyT("additionalSettings"), out var __jsonAdditionalSettings) ? (string)__jsonAdditionalSettings : (string)AdditionalSetting;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectionInfo?.ToJson(container, serializationMode); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != (((object)this._dataSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataSource.ToString()) : null, "dataSource" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._port), "port" ,container.Add ); + AddIf( null != this._encryptConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._encryptConnection) : null, "encryptConnection" ,container.Add ); + AddIf( null != (((object)this._authentication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authentication.ToString()) : null, "authentication" ,container.Add ); + AddIf( null != (((object)this._additionalSetting)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._additionalSetting.ToString()) : null, "additionalSettings" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.PowerShell.cs new file mode 100644 index 000000000000..46d425fc2a1e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A resource type and proposed name + [System.ComponentModel.TypeConverter(typeof(NameAvailabilityRequestTypeConverter))] + public partial class NameAvailabilityRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NameAvailabilityRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NameAvailabilityRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NameAvailabilityRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NameAvailabilityRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A resource type and proposed name + [System.ComponentModel.TypeConverter(typeof(NameAvailabilityRequestTypeConverter))] + public partial interface INameAvailabilityRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.TypeConverter.cs new file mode 100644 index 000000000000..17ef7c7f5eb5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NameAvailabilityRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NameAvailabilityRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NameAvailabilityRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NameAvailabilityRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.cs new file mode 100644 index 000000000000..40514e76aed2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A resource type and proposed name + public partial class NameAvailabilityRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequestInternal + { + + /// Backing field for property. + private string _name; + + /// The proposed resource name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _type; + + /// The resource type chain (e.g. virtualMachines/extensions) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public NameAvailabilityRequest() + { + + } + } + /// A resource type and proposed name + public partial interface INameAvailabilityRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The proposed resource name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The proposed resource name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The resource type chain (e.g. virtualMachines/extensions) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type chain (e.g. virtualMachines/extensions)", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// A resource type and proposed name + internal partial interface INameAvailabilityRequestInternal + + { + /// The proposed resource name + string Name { get; set; } + /// The resource type chain (e.g. virtualMachines/extensions) + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.json.cs new file mode 100644 index 000000000000..49f3441db189 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityRequest.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A resource type and proposed name + public partial class NameAvailabilityRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NameAvailabilityRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal NameAvailabilityRequest(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.PowerShell.cs new file mode 100644 index 000000000000..0c0e98fe81d4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Indicates whether a proposed resource name is available + [System.ComponentModel.TypeConverter(typeof(NameAvailabilityResponseTypeConverter))] + public partial class NameAvailabilityResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NameAvailabilityResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NameAvailabilityResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NameAvailabilityResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NameAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NameAvailabilityResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NameAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Indicates whether a proposed resource name is available + [System.ComponentModel.TypeConverter(typeof(NameAvailabilityResponseTypeConverter))] + public partial interface INameAvailabilityResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.TypeConverter.cs new file mode 100644 index 000000000000..0cb6eb1d2c40 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NameAvailabilityResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NameAvailabilityResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NameAvailabilityResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NameAvailabilityResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.cs new file mode 100644 index 000000000000..8fb6d54e871b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Indicates whether a proposed resource name is available + public partial class NameAvailabilityResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponseInternal + { + + /// Backing field for property. + private string _message; + + /// The localized reason why the name is not available, if nameAvailable is false + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private bool? _nameAvailable; + + /// If true, the name is valid and available. If false, 'reason' describes why not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? NameAvailable { get => this._nameAvailable; set => this._nameAvailable = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason? _reason; + + /// The reason why the name is not available, if nameAvailable is false + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason? Reason { get => this._reason; set => this._reason = value; } + + /// Creates an new instance. + public NameAvailabilityResponse() + { + + } + } + /// Indicates whether a proposed resource name is available + public partial interface INameAvailabilityResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The localized reason why the name is not available, if nameAvailable is false + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized reason why the name is not available, if nameAvailable is false", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// If true, the name is valid and available. If false, 'reason' describes why not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the name is valid and available. If false, 'reason' describes why not.", + SerializedName = @"nameAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? NameAvailable { get; set; } + /// The reason why the name is not available, if nameAvailable is false + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason why the name is not available, if nameAvailable is false", + SerializedName = @"reason", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason? Reason { get; set; } + + } + /// Indicates whether a proposed resource name is available + internal partial interface INameAvailabilityResponseInternal + + { + /// The localized reason why the name is not available, if nameAvailable is false + string Message { get; set; } + /// If true, the name is valid and available. If false, 'reason' describes why not. + bool? NameAvailable { get; set; } + /// The reason why the name is not available, if nameAvailable is false + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason? Reason { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.json.cs new file mode 100644 index 000000000000..90d48e912150 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NameAvailabilityResponse.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Indicates whether a proposed resource name is available + public partial class NameAvailabilityResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NameAvailabilityResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal NameAvailabilityResponse(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_nameAvailable = If( json?.PropertyT("nameAvailable"), out var __jsonNameAvailable) ? (bool?)__jsonNameAvailable : NameAvailable;} + {_reason = If( json?.PropertyT("reason"), out var __jsonReason) ? (string)__jsonReason : (string)Reason;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._nameAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._nameAvailable) : null, "nameAvailable" ,container.Add ); + AddIf( null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.PowerShell.cs new file mode 100644 index 000000000000..a7f24522c542 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(NodeMonitoringDataTypeConverter))] + public partial class NodeMonitoringData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NodeMonitoringData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NodeMonitoringData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NodeMonitoringData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AdditionalProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties) content.GetValueForProperty("AdditionalProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AdditionalProperty, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataAdditionalPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("NodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).NodeName, global::System.Convert.ToString); + } + if (content.Contains("AvailableMemoryInMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AvailableMemoryInMb = (int?) content.GetValueForProperty("AvailableMemoryInMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AvailableMemoryInMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CpuUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).CpuUtilization = (int?) content.GetValueForProperty("CpuUtilization",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).CpuUtilization, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConcurrentJobsLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsLimit = (int?) content.GetValueForProperty("ConcurrentJobsLimit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsLimit, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConcurrentJobsRunning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsRunning = (int?) content.GetValueForProperty("ConcurrentJobsRunning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsRunning, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaxConcurrentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).MaxConcurrentJob = (int?) content.GetValueForProperty("MaxConcurrentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).MaxConcurrentJob, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SentByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).SentByte = (double?) content.GetValueForProperty("SentByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).SentByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ReceivedByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ReceivedByte = (double?) content.GetValueForProperty("ReceivedByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ReceivedByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NodeMonitoringData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AdditionalProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties) content.GetValueForProperty("AdditionalProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AdditionalProperty, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataAdditionalPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("NodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).NodeName, global::System.Convert.ToString); + } + if (content.Contains("AvailableMemoryInMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AvailableMemoryInMb = (int?) content.GetValueForProperty("AvailableMemoryInMb",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).AvailableMemoryInMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CpuUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).CpuUtilization = (int?) content.GetValueForProperty("CpuUtilization",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).CpuUtilization, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConcurrentJobsLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsLimit = (int?) content.GetValueForProperty("ConcurrentJobsLimit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsLimit, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ConcurrentJobsRunning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsRunning = (int?) content.GetValueForProperty("ConcurrentJobsRunning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ConcurrentJobsRunning, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaxConcurrentJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).MaxConcurrentJob = (int?) content.GetValueForProperty("MaxConcurrentJob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).MaxConcurrentJob, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SentByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).SentByte = (double?) content.GetValueForProperty("SentByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).SentByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ReceivedByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ReceivedByte = (double?) content.GetValueForProperty("ReceivedByte",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal)this).ReceivedByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(NodeMonitoringDataTypeConverter))] + public partial interface INodeMonitoringData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.TypeConverter.cs new file mode 100644 index 000000000000..c73b43d45da7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NodeMonitoringDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NodeMonitoringData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NodeMonitoringData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NodeMonitoringData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.cs new file mode 100644 index 000000000000..bf3fc98fcafd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class NodeMonitoringData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties _additionalProperty; + + /// Unmatched properties from the message are deserialized in this collection. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties AdditionalProperty { get => (this._additionalProperty = this._additionalProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataAdditionalProperties()); } + + /// Backing field for property. + private int? _availableMemoryInMb; + + /// Available memory (MB) on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? AvailableMemoryInMb { get => this._availableMemoryInMb; } + + /// Backing field for property. + private int? _concurrentJobsLimit; + + /// Maximum concurrent jobs on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? ConcurrentJobsLimit { get => this._concurrentJobsLimit; } + + /// Backing field for property. + private int? _concurrentJobsRunning; + + /// The number of jobs currently running on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? ConcurrentJobsRunning { get => this._concurrentJobsRunning; } + + /// Backing field for property. + private int? _cpuUtilization; + + /// CPU percentage on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? CpuUtilization { get => this._cpuUtilization; } + + /// Backing field for property. + private int? _maxConcurrentJob; + + /// The maximum concurrent jobs in this integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? MaxConcurrentJob { get => this._maxConcurrentJob; } + + /// Internal Acessors for AdditionalProperty + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.AdditionalProperty { get => (this._additionalProperty = this._additionalProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataAdditionalProperties()); set { {_additionalProperty = value;} } } + + /// Internal Acessors for AvailableMemoryInMb + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.AvailableMemoryInMb { get => this._availableMemoryInMb; set { {_availableMemoryInMb = value;} } } + + /// Internal Acessors for ConcurrentJobsLimit + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.ConcurrentJobsLimit { get => this._concurrentJobsLimit; set { {_concurrentJobsLimit = value;} } } + + /// Internal Acessors for ConcurrentJobsRunning + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.ConcurrentJobsRunning { get => this._concurrentJobsRunning; set { {_concurrentJobsRunning = value;} } } + + /// Internal Acessors for CpuUtilization + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.CpuUtilization { get => this._cpuUtilization; set { {_cpuUtilization = value;} } } + + /// Internal Acessors for MaxConcurrentJob + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.MaxConcurrentJob { get => this._maxConcurrentJob; set { {_maxConcurrentJob = value;} } } + + /// Internal Acessors for NodeName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.NodeName { get => this._nodeName; set { {_nodeName = value;} } } + + /// Internal Acessors for ReceivedByte + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.ReceivedByte { get => this._receivedByte; set { {_receivedByte = value;} } } + + /// Internal Acessors for SentByte + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataInternal.SentByte { get => this._sentByte; set { {_sentByte = value;} } } + + /// Backing field for property. + private string _nodeName; + + /// Name of the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NodeName { get => this._nodeName; } + + /// Backing field for property. + private double? _receivedByte; + + /// Received bytes on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? ReceivedByte { get => this._receivedByte; } + + /// Backing field for property. + private double? _sentByte; + + /// Sent bytes on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? SentByte { get => this._sentByte; } + + /// Creates an new instance. + public NodeMonitoringData() + { + + } + } + public partial interface INodeMonitoringData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Unmatched properties from the message are deserialized in this collection. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @" Unmatched properties from the message are deserialized in this collection.", + SerializedName = @"additionalProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties AdditionalProperty { get; } + /// Available memory (MB) on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Available memory (MB) on the integration runtime node.", + SerializedName = @"availableMemoryInMB", + PossibleTypes = new [] { typeof(int) })] + int? AvailableMemoryInMb { get; } + /// Maximum concurrent jobs on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Maximum concurrent jobs on the integration runtime node.", + SerializedName = @"concurrentJobsLimit", + PossibleTypes = new [] { typeof(int) })] + int? ConcurrentJobsLimit { get; } + /// The number of jobs currently running on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of jobs currently running on the integration runtime node.", + SerializedName = @"concurrentJobsRunning", + PossibleTypes = new [] { typeof(int) })] + int? ConcurrentJobsRunning { get; } + /// CPU percentage on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"CPU percentage on the integration runtime node.", + SerializedName = @"cpuUtilization", + PossibleTypes = new [] { typeof(int) })] + int? CpuUtilization { get; } + /// The maximum concurrent jobs in this integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The maximum concurrent jobs in this integration runtime.", + SerializedName = @"maxConcurrentJobs", + PossibleTypes = new [] { typeof(int) })] + int? MaxConcurrentJob { get; } + /// Name of the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the integration runtime node.", + SerializedName = @"nodeName", + PossibleTypes = new [] { typeof(string) })] + string NodeName { get; } + /// Received bytes on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Received bytes on the integration runtime node.", + SerializedName = @"receivedBytes", + PossibleTypes = new [] { typeof(double) })] + double? ReceivedByte { get; } + /// Sent bytes on the integration runtime node. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Sent bytes on the integration runtime node.", + SerializedName = @"sentBytes", + PossibleTypes = new [] { typeof(double) })] + double? SentByte { get; } + + } + internal partial interface INodeMonitoringDataInternal + + { + /// Unmatched properties from the message are deserialized in this collection. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties AdditionalProperty { get; set; } + /// Available memory (MB) on the integration runtime node. + int? AvailableMemoryInMb { get; set; } + /// Maximum concurrent jobs on the integration runtime node. + int? ConcurrentJobsLimit { get; set; } + /// The number of jobs currently running on the integration runtime node. + int? ConcurrentJobsRunning { get; set; } + /// CPU percentage on the integration runtime node. + int? CpuUtilization { get; set; } + /// The maximum concurrent jobs in this integration runtime. + int? MaxConcurrentJob { get; set; } + /// Name of the integration runtime node. + string NodeName { get; set; } + /// Received bytes on the integration runtime node. + double? ReceivedByte { get; set; } + /// Sent bytes on the integration runtime node. + double? SentByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.json.cs new file mode 100644 index 000000000000..0bd18a3398a0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringData.json.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class NodeMonitoringData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NodeMonitoringData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal NodeMonitoringData(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_additionalProperty = If( json?.PropertyT("additionalProperties"), out var __jsonAdditionalProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataAdditionalProperties.FromJson(__jsonAdditionalProperties) : AdditionalProperty;} + {_nodeName = If( json?.PropertyT("nodeName"), out var __jsonNodeName) ? (string)__jsonNodeName : (string)NodeName;} + {_availableMemoryInMb = If( json?.PropertyT("availableMemoryInMB"), out var __jsonAvailableMemoryInMb) ? (int?)__jsonAvailableMemoryInMb : AvailableMemoryInMb;} + {_cpuUtilization = If( json?.PropertyT("cpuUtilization"), out var __jsonCpuUtilization) ? (int?)__jsonCpuUtilization : CpuUtilization;} + {_concurrentJobsLimit = If( json?.PropertyT("concurrentJobsLimit"), out var __jsonConcurrentJobsLimit) ? (int?)__jsonConcurrentJobsLimit : ConcurrentJobsLimit;} + {_concurrentJobsRunning = If( json?.PropertyT("concurrentJobsRunning"), out var __jsonConcurrentJobsRunning) ? (int?)__jsonConcurrentJobsRunning : ConcurrentJobsRunning;} + {_maxConcurrentJob = If( json?.PropertyT("maxConcurrentJobs"), out var __jsonMaxConcurrentJobs) ? (int?)__jsonMaxConcurrentJobs : MaxConcurrentJob;} + {_sentByte = If( json?.PropertyT("sentBytes"), out var __jsonSentBytes) ? (double?)__jsonSentBytes : SentByte;} + {_receivedByte = If( json?.PropertyT("receivedBytes"), out var __jsonReceivedBytes) ? (double?)__jsonReceivedBytes : ReceivedByte;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._additionalProperty ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._additionalProperty.ToJson(null,serializationMode) : null, "additionalProperties" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nodeName.ToString()) : null, "nodeName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._availableMemoryInMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._availableMemoryInMb) : null, "availableMemoryInMB" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cpuUtilization ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._cpuUtilization) : null, "cpuUtilization" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._concurrentJobsLimit ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._concurrentJobsLimit) : null, "concurrentJobsLimit" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._concurrentJobsRunning ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._concurrentJobsRunning) : null, "concurrentJobsRunning" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maxConcurrentJob ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._maxConcurrentJob) : null, "maxConcurrentJobs" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sentByte ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._sentByte) : null, "sentBytes" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._receivedByte ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._receivedByte) : null, "receivedBytes" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.PowerShell.cs new file mode 100644 index 000000000000..9f07869adb2c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Unmatched properties from the message are deserialized in this collection. + [System.ComponentModel.TypeConverter(typeof(NodeMonitoringDataAdditionalPropertiesTypeConverter))] + public partial class NodeMonitoringDataAdditionalProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NodeMonitoringDataAdditionalProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NodeMonitoringDataAdditionalProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NodeMonitoringDataAdditionalProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NodeMonitoringDataAdditionalProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Unmatched properties from the message are deserialized in this collection. + [System.ComponentModel.TypeConverter(typeof(NodeMonitoringDataAdditionalPropertiesTypeConverter))] + public partial interface INodeMonitoringDataAdditionalProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.TypeConverter.cs new file mode 100644 index 000000000000..cbe2a414a271 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NodeMonitoringDataAdditionalPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NodeMonitoringDataAdditionalProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NodeMonitoringDataAdditionalProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NodeMonitoringDataAdditionalProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.cs new file mode 100644 index 000000000000..2ec35572e1bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Unmatched properties from the message are deserialized in this collection. + public partial class NodeMonitoringDataAdditionalProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalPropertiesInternal + { + + /// Creates an new instance. + public NodeMonitoringDataAdditionalProperties() + { + + } + } + /// Unmatched properties from the message are deserialized in this collection. + public partial interface INodeMonitoringDataAdditionalProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Unmatched properties from the message are deserialized in this collection. + internal partial interface INodeMonitoringDataAdditionalPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.dictionary.cs new file mode 100644 index 000000000000..f6d193adb726 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class NodeMonitoringDataAdditionalProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NodeMonitoringDataAdditionalProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.json.cs new file mode 100644 index 000000000000..50e0f1721ce2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NodeMonitoringDataAdditionalProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Unmatched properties from the message are deserialized in this collection. + public partial class NodeMonitoringDataAdditionalProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INodeMonitoringDataAdditionalProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NodeMonitoringDataAdditionalProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal NodeMonitoringDataAdditionalProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.PowerShell.cs new file mode 100644 index 000000000000..498055d1f5cb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Defines metadata for table to be migrated + [System.ComponentModel.TypeConverter(typeof(NonSqlDataMigrationTableTypeConverter))] + public partial class NonSqlDataMigrationTable + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NonSqlDataMigrationTable(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NonSqlDataMigrationTable(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NonSqlDataMigrationTable(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableInternal)this).SourceName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NonSqlDataMigrationTable(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableInternal)this).SourceName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Defines metadata for table to be migrated + [System.ComponentModel.TypeConverter(typeof(NonSqlDataMigrationTableTypeConverter))] + public partial interface INonSqlDataMigrationTable + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.TypeConverter.cs new file mode 100644 index 000000000000..82102d052f9d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NonSqlDataMigrationTableTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NonSqlDataMigrationTable.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NonSqlDataMigrationTable.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NonSqlDataMigrationTable.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.cs new file mode 100644 index 000000000000..0a0b7f86b066 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Defines metadata for table to be migrated + public partial class NonSqlDataMigrationTable : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableInternal + { + + /// Backing field for property. + private string _sourceName; + + /// Source table name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceName { get => this._sourceName; set => this._sourceName = value; } + + /// Creates an new instance. + public NonSqlDataMigrationTable() + { + + } + } + /// Defines metadata for table to be migrated + public partial interface INonSqlDataMigrationTable : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Source table name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source table name", + SerializedName = @"sourceName", + PossibleTypes = new [] { typeof(string) })] + string SourceName { get; set; } + + } + /// Defines metadata for table to be migrated + internal partial interface INonSqlDataMigrationTableInternal + + { + /// Source table name + string SourceName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.json.cs new file mode 100644 index 000000000000..b85d9885ca47 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTable.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Defines metadata for table to be migrated + public partial class NonSqlDataMigrationTable + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NonSqlDataMigrationTable(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal NonSqlDataMigrationTable(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceName = If( json?.PropertyT("sourceName"), out var __jsonSourceName) ? (string)__jsonSourceName : (string)SourceName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceName.ToString()) : null, "sourceName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.PowerShell.cs new file mode 100644 index 000000000000..195b425bd583 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Object used to report the data migration results of a table + [System.ComponentModel.TypeConverter(typeof(NonSqlDataMigrationTableResultTypeConverter))] + public partial class NonSqlDataMigrationTableResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NonSqlDataMigrationTableResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NonSqlDataMigrationTableResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NonSqlDataMigrationTableResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResultCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ResultCode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode?) content.GetValueForProperty("ResultCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ResultCode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode.CreateFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("TargetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetName = (string) content.GetValueForProperty("TargetName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetName, global::System.Convert.ToString); + } + if (content.Contains("SourceRowCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceRowCount = (long?) content.GetValueForProperty("SourceRowCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceRowCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetRowCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetRowCount = (long?) content.GetValueForProperty("TargetRowCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetRowCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTimeInMilisecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ElapsedTimeInMilisecond = (double?) content.GetValueForProperty("ElapsedTimeInMilisecond",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ElapsedTimeInMilisecond, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NonSqlDataMigrationTableResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResultCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ResultCode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode?) content.GetValueForProperty("ResultCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ResultCode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode.CreateFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("TargetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetName = (string) content.GetValueForProperty("TargetName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetName, global::System.Convert.ToString); + } + if (content.Contains("SourceRowCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceRowCount = (long?) content.GetValueForProperty("SourceRowCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).SourceRowCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetRowCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetRowCount = (long?) content.GetValueForProperty("TargetRowCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).TargetRowCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ElapsedTimeInMilisecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ElapsedTimeInMilisecond = (double?) content.GetValueForProperty("ElapsedTimeInMilisecond",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).ElapsedTimeInMilisecond, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationErrorTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Object used to report the data migration results of a table + [System.ComponentModel.TypeConverter(typeof(NonSqlDataMigrationTableResultTypeConverter))] + public partial interface INonSqlDataMigrationTableResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.TypeConverter.cs new file mode 100644 index 000000000000..f9bd74532869 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NonSqlDataMigrationTableResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NonSqlDataMigrationTableResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NonSqlDataMigrationTableResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NonSqlDataMigrationTableResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.cs new file mode 100644 index 000000000000..d63b0d8ed329 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Object used to report the data migration results of a table + public partial class NonSqlDataMigrationTableResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal + { + + /// Backing field for property. + private double? _elapsedTimeInMilisecond; + + /// Time taken to migrate the data + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? ElapsedTimeInMilisecond { get => this._elapsedTimeInMilisecond; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError[] _error; + + /// List of errors, if any, during migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError[] Error { get => this._error; } + + /// Internal Acessors for ElapsedTimeInMilisecond + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal.ElapsedTimeInMilisecond { get => this._elapsedTimeInMilisecond; set { {_elapsedTimeInMilisecond = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal.Error { get => this._error; set { {_error = value;} } } + + /// Internal Acessors for ResultCode + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal.ResultCode { get => this._resultCode; set { {_resultCode = value;} } } + + /// Internal Acessors for SourceName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal.SourceName { get => this._sourceName; set { {_sourceName = value;} } } + + /// Internal Acessors for SourceRowCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal.SourceRowCount { get => this._sourceRowCount; set { {_sourceRowCount = value;} } } + + /// Internal Acessors for TargetName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal.TargetName { get => this._targetName; set { {_targetName = value;} } } + + /// Internal Acessors for TargetRowCount + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResultInternal.TargetRowCount { get => this._targetRowCount; set { {_targetRowCount = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode? _resultCode; + + /// Result code of the data migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode? ResultCode { get => this._resultCode; } + + /// Backing field for property. + private string _sourceName; + + /// Name of the source table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceName { get => this._sourceName; } + + /// Backing field for property. + private long? _sourceRowCount; + + /// Number of rows in the source table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? SourceRowCount { get => this._sourceRowCount; } + + /// Backing field for property. + private string _targetName; + + /// Name of the target table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetName { get => this._targetName; } + + /// Backing field for property. + private long? _targetRowCount; + + /// Number of rows in the target table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? TargetRowCount { get => this._targetRowCount; } + + /// Creates an new instance. + public NonSqlDataMigrationTableResult() + { + + } + } + /// Object used to report the data migration results of a table + public partial interface INonSqlDataMigrationTableResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Time taken to migrate the data + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Time taken to migrate the data", + SerializedName = @"elapsedTimeInMiliseconds", + PossibleTypes = new [] { typeof(double) })] + double? ElapsedTimeInMilisecond { get; } + /// List of errors, if any, during migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of errors, if any, during migration", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError[] Error { get; } + /// Result code of the data migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result code of the data migration", + SerializedName = @"resultCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode? ResultCode { get; } + /// Name of the source table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the source table", + SerializedName = @"sourceName", + PossibleTypes = new [] { typeof(string) })] + string SourceName { get; } + /// Number of rows in the source table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of rows in the source table", + SerializedName = @"sourceRowCount", + PossibleTypes = new [] { typeof(long) })] + long? SourceRowCount { get; } + /// Name of the target table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the target table", + SerializedName = @"targetName", + PossibleTypes = new [] { typeof(string) })] + string TargetName { get; } + /// Number of rows in the target table + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of rows in the target table", + SerializedName = @"targetRowCount", + PossibleTypes = new [] { typeof(long) })] + long? TargetRowCount { get; } + + } + /// Object used to report the data migration results of a table + internal partial interface INonSqlDataMigrationTableResultInternal + + { + /// Time taken to migrate the data + double? ElapsedTimeInMilisecond { get; set; } + /// List of errors, if any, during migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError[] Error { get; set; } + /// Result code of the data migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode? ResultCode { get; set; } + /// Name of the source table + string SourceName { get; set; } + /// Number of rows in the source table + long? SourceRowCount { get; set; } + /// Name of the target table + string TargetName { get; set; } + /// Number of rows in the target table + long? TargetRowCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.json.cs new file mode 100644 index 000000000000..56c44dccdc55 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlDataMigrationTableResult.json.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Object used to report the data migration results of a table + public partial class NonSqlDataMigrationTableResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTableResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NonSqlDataMigrationTableResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal NonSqlDataMigrationTableResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resultCode = If( json?.PropertyT("resultCode"), out var __jsonResultCode) ? (string)__jsonResultCode : (string)ResultCode;} + {_sourceName = If( json?.PropertyT("sourceName"), out var __jsonSourceName) ? (string)__jsonSourceName : (string)SourceName;} + {_targetName = If( json?.PropertyT("targetName"), out var __jsonTargetName) ? (string)__jsonTargetName : (string)TargetName;} + {_sourceRowCount = If( json?.PropertyT("sourceRowCount"), out var __jsonSourceRowCount) ? (long?)__jsonSourceRowCount : SourceRowCount;} + {_targetRowCount = If( json?.PropertyT("targetRowCount"), out var __jsonTargetRowCount) ? (long?)__jsonTargetRowCount : TargetRowCount;} + {_elapsedTimeInMilisecond = If( json?.PropertyT("elapsedTimeInMiliseconds"), out var __jsonElapsedTimeInMiliseconds) ? (double?)__jsonElapsedTimeInMiliseconds : ElapsedTimeInMilisecond;} + {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? If( __jsonErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationError) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationError.FromJson(__u) )) ))() : null : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resultCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resultCode.ToString()) : null, "resultCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceName.ToString()) : null, "sourceName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetName.ToString()) : null, "targetName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sourceRowCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._sourceRowCount) : null, "sourceRowCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._targetRowCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._targetRowCount) : null, "targetRowCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._elapsedTimeInMilisecond ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._elapsedTimeInMilisecond) : null, "elapsedTimeInMiliseconds" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._error) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._error ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("errors",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.PowerShell.cs new file mode 100644 index 000000000000..a70dc9964b21 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.PowerShell.cs @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Base class for non sql migration task input + [System.ComponentModel.TypeConverter(typeof(NonSqlMigrationTaskInputTypeConverter))] + public partial class NonSqlMigrationTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NonSqlMigrationTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NonSqlMigrationTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NonSqlMigrationTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("ProjectLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectLocation = (string) content.GetValueForProperty("ProjectLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectLocation, global::System.Convert.ToString); + } + if (content.Contains("SelectedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).SelectedTable = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable[]) content.GetValueForProperty("SelectedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).SelectedTable, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlDataMigrationTableTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NonSqlMigrationTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetDatabaseName = (string) content.GetValueForProperty("TargetDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("ProjectLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectLocation = (string) content.GetValueForProperty("ProjectLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).ProjectLocation, global::System.Convert.ToString); + } + if (content.Contains("SelectedTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).SelectedTable = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable[]) content.GetValueForProperty("SelectedTable",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).SelectedTable, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlDataMigrationTableTypeConverter.ConvertFrom)); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for non sql migration task input + [System.ComponentModel.TypeConverter(typeof(NonSqlMigrationTaskInputTypeConverter))] + public partial interface INonSqlMigrationTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..7ef38321263e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NonSqlMigrationTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NonSqlMigrationTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NonSqlMigrationTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NonSqlMigrationTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.cs new file mode 100644 index 000000000000..fd5684493175 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for non sql migration task input + public partial class NonSqlMigrationTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal + { + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private string _projectLocation; + + /// A URL that points to the drop location to access project artifacts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProjectLocation { get => this._projectLocation; set => this._projectLocation = value; } + + /// Backing field for property. + private string _projectName; + + /// Name of the migration project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable[] _selectedTable; + + /// Metadata of the tables selected for migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable[] SelectedTable { get => this._selectedTable; set => this._selectedTable = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private string _targetDatabaseName; + + /// Target database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDatabaseName { get => this._targetDatabaseName; set => this._targetDatabaseName = value; } + + /// Creates an new instance. + public NonSqlMigrationTaskInput() + { + + } + } + /// Base class for non sql migration task input + public partial interface INonSqlMigrationTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// A URL that points to the drop location to access project artifacts + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A URL that points to the drop location to access project artifacts", + SerializedName = @"projectLocation", + PossibleTypes = new [] { typeof(string) })] + string ProjectLocation { get; set; } + /// Name of the migration project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the migration project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + string ProjectName { get; set; } + /// Metadata of the tables selected for migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Metadata of the tables selected for migration", + SerializedName = @"selectedTables", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable[] SelectedTable { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + /// Target database name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Target database name", + SerializedName = @"targetDatabaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetDatabaseName { get; set; } + + } + /// Base class for non sql migration task input + internal partial interface INonSqlMigrationTaskInputInternal + + { + /// A URL that points to the drop location to access project artifacts + string ProjectLocation { get; set; } + /// Name of the migration project + string ProjectName { get; set; } + /// Metadata of the tables selected for migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable[] SelectedTable { get; set; } + /// Information for connecting to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + /// Target database name + string TargetDatabaseName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.json.cs new file mode 100644 index 000000000000..cabaddf23f15 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskInput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for non sql migration task input + public partial class NonSqlMigrationTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NonSqlMigrationTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal NonSqlMigrationTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_targetDatabaseName = If( json?.PropertyT("targetDatabaseName"), out var __jsonTargetDatabaseName) ? (string)__jsonTargetDatabaseName : (string)TargetDatabaseName;} + {_projectName = If( json?.PropertyT("projectName"), out var __jsonProjectName) ? (string)__jsonProjectName : (string)ProjectName;} + {_projectLocation = If( json?.PropertyT("projectLocation"), out var __jsonProjectLocation) ? (string)__jsonProjectLocation : (string)ProjectLocation;} + {_selectedTable = If( json?.PropertyT("selectedTables"), out var __jsonSelectedTables) ? If( __jsonSelectedTables as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlDataMigrationTable) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NonSqlDataMigrationTable.FromJson(__u) )) ))() : null : SelectedTable;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != (((object)this._targetDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseName.ToString()) : null, "targetDatabaseName" ,container.Add ); + AddIf( null != (((object)this._projectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._projectName.ToString()) : null, "projectName" ,container.Add ); + AddIf( null != (((object)this._projectLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._projectLocation.ToString()) : null, "projectLocation" ,container.Add ); + if (null != this._selectedTable) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedTable ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedTables",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..4b17b2d9c3b6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Base class for non sql migration task output + [System.ComponentModel.TypeConverter(typeof(NonSqlMigrationTaskOutputTypeConverter))] + public partial class NonSqlMigrationTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NonSqlMigrationTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NonSqlMigrationTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NonSqlMigrationTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("DataMigrationTableResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).DataMigrationTableResult = (string) content.GetValueForProperty("DataMigrationTableResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).DataMigrationTableResult, global::System.Convert.ToString); + } + if (content.Contains("ProgressMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).ProgressMessage = (string) content.GetValueForProperty("ProgressMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).ProgressMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).TargetServerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NonSqlMigrationTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("StartedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).StartedOn = (global::System.DateTime?) content.GetValueForProperty("StartedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).StartedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).EndedOn = (global::System.DateTime?) content.GetValueForProperty("EndedOn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).EndedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus.CreateFrom); + } + if (content.Contains("DataMigrationTableResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).DataMigrationTableResult = (string) content.GetValueForProperty("DataMigrationTableResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).DataMigrationTableResult, global::System.Convert.ToString); + } + if (content.Contains("ProgressMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).ProgressMessage = (string) content.GetValueForProperty("ProgressMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).ProgressMessage, global::System.Convert.ToString); + } + if (content.Contains("SourceServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).SourceServerName = (string) content.GetValueForProperty("SourceServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).SourceServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).TargetServerName = (string) content.GetValueForProperty("TargetServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal)this).TargetServerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for non sql migration task output + [System.ComponentModel.TypeConverter(typeof(NonSqlMigrationTaskOutputTypeConverter))] + public partial interface INonSqlMigrationTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..5e685ffeccb6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NonSqlMigrationTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NonSqlMigrationTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NonSqlMigrationTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NonSqlMigrationTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.cs new file mode 100644 index 000000000000..b1f1120f635c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for non sql migration task output + public partial class NonSqlMigrationTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal + { + + /// Backing field for property. + private string _dataMigrationTableResult; + + /// + /// Results of the migration. The key contains the table name and the value the table result object + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DataMigrationTableResult { get => this._dataMigrationTableResult; } + + /// Backing field for property. + private global::System.DateTime? _endedOn; + + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? EndedOn { get => this._endedOn; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for DataMigrationTableResult + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.DataMigrationTableResult { get => this._dataMigrationTableResult; set { {_dataMigrationTableResult = value;} } } + + /// Internal Acessors for EndedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.EndedOn { get => this._endedOn; set { {_endedOn = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for ProgressMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.ProgressMessage { get => this._progressMessage; set { {_progressMessage = value;} } } + + /// Internal Acessors for SourceServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.SourceServerName { get => this._sourceServerName; set { {_sourceServerName = value;} } } + + /// Internal Acessors for StartedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.StartedOn { get => this._startedOn; set { {_startedOn = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TargetServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutputInternal.TargetServerName { get => this._targetServerName; set { {_targetServerName = value;} } } + + /// Backing field for property. + private string _progressMessage; + + /// Message about the progress of the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProgressMessage { get => this._progressMessage; } + + /// Backing field for property. + private string _sourceServerName; + + /// Name of source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SourceServerName { get => this._sourceServerName; } + + /// Backing field for property. + private global::System.DateTime? _startedOn; + + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? StartedOn { get => this._startedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? _status; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get => this._status; } + + /// Backing field for property. + private string _targetServerName; + + /// Name of target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetServerName { get => this._targetServerName; } + + /// Creates an new instance. + public NonSqlMigrationTaskOutput() + { + + } + } + /// Base class for non sql migration task output + public partial interface INonSqlMigrationTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// Results of the migration. The key contains the table name and the value the table result object + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Results of the migration. The key contains the table name and the value the table result object", + SerializedName = @"dataMigrationTableResults", + PossibleTypes = new [] { typeof(string) })] + string DataMigrationTableResult { get; } + /// Migration end time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration end time", + SerializedName = @"endedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndedOn { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Message about the progress of the migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Message about the progress of the migration", + SerializedName = @"progressMessage", + PossibleTypes = new [] { typeof(string) })] + string ProgressMessage { get; } + /// Name of source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of source server", + SerializedName = @"sourceServerName", + PossibleTypes = new [] { typeof(string) })] + string SourceServerName { get; } + /// Migration start time + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration start time", + SerializedName = @"startedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedOn { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; } + /// Name of target server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of target server", + SerializedName = @"targetServerName", + PossibleTypes = new [] { typeof(string) })] + string TargetServerName { get; } + + } + /// Base class for non sql migration task output + internal partial interface INonSqlMigrationTaskOutputInternal + + { + /// + /// Results of the migration. The key contains the table name and the value the table result object + /// + string DataMigrationTableResult { get; set; } + /// Migration end time + global::System.DateTime? EndedOn { get; set; } + /// Result identifier + string Id { get; set; } + /// Message about the progress of the migration + string ProgressMessage { get; set; } + /// Name of source server + string SourceServerName { get; set; } + /// Migration start time + global::System.DateTime? StartedOn { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus? Status { get; set; } + /// Name of target server + string TargetServerName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.json.cs new file mode 100644 index 000000000000..cfe00359b4c9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/NonSqlMigrationTaskOutput.json.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for non sql migration task output + public partial class NonSqlMigrationTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INonSqlMigrationTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new NonSqlMigrationTaskOutput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal NonSqlMigrationTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_startedOn = If( json?.PropertyT("startedOn"), out var __jsonStartedOn) ? global::System.DateTime.TryParse((string)__jsonStartedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedOnValue) ? __jsonStartedOnValue : StartedOn : StartedOn;} + {_endedOn = If( json?.PropertyT("endedOn"), out var __jsonEndedOn) ? global::System.DateTime.TryParse((string)__jsonEndedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndedOnValue) ? __jsonEndedOnValue : EndedOn : EndedOn;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_dataMigrationTableResult = If( json?.PropertyT("dataMigrationTableResults"), out var __jsonDataMigrationTableResults) ? (string)__jsonDataMigrationTableResults : (string)DataMigrationTableResult;} + {_progressMessage = If( json?.PropertyT("progressMessage"), out var __jsonProgressMessage) ? (string)__jsonProgressMessage : (string)ProgressMessage;} + {_sourceServerName = If( json?.PropertyT("sourceServerName"), out var __jsonSourceServerName) ? (string)__jsonSourceServerName : (string)SourceServerName;} + {_targetServerName = If( json?.PropertyT("targetServerName"), out var __jsonTargetServerName) ? (string)__jsonTargetServerName : (string)TargetServerName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._dataMigrationTableResult)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataMigrationTableResult.ToString()) : null, "dataMigrationTableResults" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._progressMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._progressMessage.ToString()) : null, "progressMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerName.ToString()) : null, "sourceServerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetServerName.ToString()) : null, "targetServerName" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.PowerShell.cs new file mode 100644 index 000000000000..5c4a4dda37b9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Error information in OData format. + [System.ComponentModel.TypeConverter(typeof(ODataErrorTypeConverter))] + public partial class ODataError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ODataError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ODataError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ODataError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ODataError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error information in OData format. + [System.ComponentModel.TypeConverter(typeof(ODataErrorTypeConverter))] + public partial interface IODataError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.TypeConverter.cs new file mode 100644 index 000000000000..a248a882c32a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ODataErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ODataError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ODataError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ODataError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.cs new file mode 100644 index 000000000000..632f9ef32c9d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Error information in OData format. + public partial class ODataError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataErrorInternal + { + + /// Backing field for property. + private string _code; + + /// + /// The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError' + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] _detail; + + /// Inner errors that caused this error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _message; + + /// The human-readable description of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public ODataError() + { + + } + } + /// Error information in OData format. + public partial interface IODataError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError' + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Inner errors that caused this error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inner errors that caused this error", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Detail { get; set; } + /// The human-readable description of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The human-readable description of the error", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error information in OData format. + internal partial interface IODataErrorInternal + + { + /// + /// The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError' + /// + string Code { get; set; } + /// Inner errors that caused this error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Detail { get; set; } + /// The human-readable description of the error + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.json.cs new file mode 100644 index 000000000000..46f7eaeb6fb6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ODataError.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Error information in OData format. + public partial class ODataError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ODataError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ODataError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.PowerShell.cs new file mode 100644 index 000000000000..d289c3de2d27 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Offline configuration + [System.ComponentModel.TypeConverter(typeof(OfflineConfigurationTypeConverter))] + public partial class OfflineConfiguration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OfflineConfiguration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OfflineConfiguration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OfflineConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Offline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).Offline = (bool?) content.GetValueForProperty("Offline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).Offline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).LastBackupName = (string) content.GetValueForProperty("LastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).LastBackupName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OfflineConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Offline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).Offline = (bool?) content.GetValueForProperty("Offline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).Offline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastBackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).LastBackupName = (string) content.GetValueForProperty("LastBackupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal)this).LastBackupName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Offline configuration + [System.ComponentModel.TypeConverter(typeof(OfflineConfigurationTypeConverter))] + public partial interface IOfflineConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..1ac44a39514e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OfflineConfigurationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OfflineConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OfflineConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OfflineConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.cs new file mode 100644 index 000000000000..1140abef0207 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Offline configuration + public partial class OfflineConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfigurationInternal + { + + /// Backing field for property. + private string _lastBackupName; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LastBackupName { get => this._lastBackupName; set => this._lastBackupName = value; } + + /// Backing field for property. + private bool? _offline; + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? Offline { get => this._offline; set => this._offline = value; } + + /// Creates an new instance. + public OfflineConfiguration() + { + + } + } + /// Offline configuration + public partial interface IOfflineConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"lastBackupName", + PossibleTypes = new [] { typeof(string) })] + string LastBackupName { get; set; } + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? Offline { get; set; } + + } + /// Offline configuration + internal partial interface IOfflineConfigurationInternal + + { + /// + /// 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. + /// + string LastBackupName { get; set; } + /// Offline migration + bool? Offline { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.json.cs new file mode 100644 index 000000000000..047b43d6e2f5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OfflineConfiguration.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Offline configuration + public partial class OfflineConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOfflineConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OfflineConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal OfflineConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_offline = If( json?.PropertyT("offline"), out var __jsonOffline) ? (bool?)__jsonOffline : Offline;} + {_lastBackupName = If( json?.PropertyT("lastBackupName"), out var __jsonLastBackupName) ? (string)__jsonLastBackupName : (string)LastBackupName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._offline ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._offline) : null, "offline" ,container.Add ); + AddIf( null != (((object)this._lastBackupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastBackupName.ToString()) : null, "lastBackupName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..f19d3170328f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Result of the request to list SQL operations. + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial class OperationListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the request to list SQL operations. + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial interface IOperationListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..e706aae599be --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.cs new file mode 100644 index 000000000000..72ad1d9f3cb7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Result of the request to list SQL operations. + public partial class OperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition[] _value; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition[] Value { get => this._value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// Result of the request to list SQL operations. + public partial interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition[] Value { get; } + + } + /// Result of the request to list SQL operations. + internal partial interface IOperationListResultInternal + + { + string NextLink { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.json.cs new file mode 100644 index 000000000000..5a5e5980ccee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationListResult.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Result of the request to list SQL operations. + public partial class OperationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinition.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.PowerShell.cs new file mode 100644 index 000000000000..6f9ade95d045 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(OperationsDefinitionTypeConverter))] + public partial class OperationsDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationsDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationsDefinition(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationsDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDisplayDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin.CreateFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationsDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDisplayDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin.CreateFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(OperationsDefinitionTypeConverter))] + public partial interface IOperationsDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.TypeConverter.cs new file mode 100644 index 000000000000..02f502c050d1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationsDefinitionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationsDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationsDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationsDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.cs new file mode 100644 index 000000000000..a98485138b17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class OperationsDefinition : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition _display; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDisplayDefinition()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Description; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Operation; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Provider; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Resource; } + + /// Backing field for property. + private bool? _isDataAction; + + /// Indicates whether the operation is a data action + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsDataAction { get => this._isDataAction; set => this._isDataAction = value; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDisplayDefinition()); set { {_display = value;} } } + + /// Internal Acessors for DisplayDescription + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Description = value; } + + /// Internal Acessors for DisplayOperation + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Operation = value; } + + /// Internal Acessors for DisplayProvider + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Provider = value; } + + /// Internal Acessors for DisplayResource + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)Display).Resource = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Origin + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.Origin { get => this._origin; set { {_origin = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionProperties()); set { {_property = value;} } } + + /// Backing field for property. + private string _name; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin? _origin; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin? Origin { get => this._origin; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties _property; + + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionProperties()); } + + /// Creates an new instance. + public OperationsDefinition() + { + + } + } + public partial interface IOperationsDefinition : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; } + /// Indicates whether the operation is a data action + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the operation is a data action", + SerializedName = @"isDataAction", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDataAction { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin? Origin { get; } + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dictionary of ", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties Property { get; } + + } + internal partial interface IOperationsDefinitionInternal + + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition Display { get; set; } + + string DisplayDescription { get; set; } + + string DisplayOperation { get; set; } + + string DisplayProvider { get; set; } + + string DisplayResource { get; set; } + /// Indicates whether the operation is a data action + bool? IsDataAction { get; set; } + + string Name { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin? Origin { get; set; } + /// Dictionary of + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.json.cs new file mode 100644 index 000000000000..33f6cf7c0655 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinition.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class OperationsDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OperationsDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal OperationsDefinition(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDisplayDefinition.FromJson(__jsonDisplay) : Display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.PowerShell.cs new file mode 100644 index 000000000000..4b91f70772f5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(OperationsDefinitionPropertiesTypeConverter))] + public partial class OperationsDefinitionProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationsDefinitionProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationsDefinitionProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationsDefinitionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationsDefinitionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(OperationsDefinitionPropertiesTypeConverter))] + public partial interface IOperationsDefinitionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.TypeConverter.cs new file mode 100644 index 000000000000..4006d81bee67 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationsDefinitionPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationsDefinitionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationsDefinitionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationsDefinitionProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.cs new file mode 100644 index 000000000000..f563a3836c78 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class OperationsDefinitionProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionPropertiesInternal + { + + /// Creates an new instance. + public OperationsDefinitionProperties() + { + + } + } + /// Dictionary of + public partial interface IOperationsDefinitionProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Dictionary of + internal partial interface IOperationsDefinitionPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.dictionary.cs new file mode 100644 index 000000000000..f4612af9e0af --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class OperationsDefinitionProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.OperationsDefinitionProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.json.cs new file mode 100644 index 000000000000..e6dd3107b694 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDefinitionProperties.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class OperationsDefinitionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinitionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OperationsDefinitionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal OperationsDefinitionProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.PowerShell.cs new file mode 100644 index 000000000000..77a6b057c83a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(OperationsDisplayDefinitionTypeConverter))] + public partial class OperationsDisplayDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationsDisplayDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationsDisplayDefinition(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationsDisplayDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationsDisplayDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(OperationsDisplayDefinitionTypeConverter))] + public partial interface IOperationsDisplayDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.TypeConverter.cs new file mode 100644 index 000000000000..eb3a58729443 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationsDisplayDefinitionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationsDisplayDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationsDisplayDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationsDisplayDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.cs new file mode 100644 index 000000000000..9e86c479eb65 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class OperationsDisplayDefinition : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal + { + + /// Backing field for property. + private string _description; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Operation + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal.Operation { get => this._operation; set { {_operation = value;} } } + + /// Internal Acessors for Provider + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal.Provider { get => this._provider; set { {_provider = value;} } } + + /// Internal Acessors for Resource + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinitionInternal.Resource { get => this._resource; set { {_resource = value;} } } + + /// Backing field for property. + private string _operation; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Operation { get => this._operation; } + + /// Backing field for property. + private string _provider; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Provider { get => this._provider; } + + /// Backing field for property. + private string _resource; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Resource { get => this._resource; } + + /// Creates an new instance. + public OperationsDisplayDefinition() + { + + } + } + public partial interface IOperationsDisplayDefinition : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; } + + } + internal partial interface IOperationsDisplayDefinitionInternal + + { + string Description { get; set; } + + string Operation { get; set; } + + string Provider { get; set; } + + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.json.cs new file mode 100644 index 000000000000..e6ae25aa47be --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OperationsDisplayDefinition.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class OperationsDisplayDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDisplayDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OperationsDisplayDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal OperationsDisplayDefinition(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.PowerShell.cs new file mode 100644 index 000000000000..675d962a8dc6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information for connecting to Oracle server + [System.ComponentModel.TypeConverter(typeof(OracleConnectionInfoTypeConverter))] + public partial class OracleConnectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OracleConnectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OracleConnectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OracleConnectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OracleConnectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information for connecting to Oracle server + [System.ComponentModel.TypeConverter(typeof(OracleConnectionInfoTypeConverter))] + public partial interface IOracleConnectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..dcb958c07c07 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OracleConnectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OracleConnectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OracleConnectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OracleConnectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.cs new file mode 100644 index 000000000000..3866e0f4fc66 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to Oracle server + public partial class OracleConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? _authentication; + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get => this._authentication; set => this._authentication = value; } + + /// Backing field for property. + private string _dataSource; + + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DataSource { get => this._dataSource; set => this._dataSource = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password = value ?? null; } + + /// Backing field for property. + private int? _port; + + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Port { get => this._port; set => this._port = value; } + + /// Backing field for property. + private string _serverName; + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Backing field for property. + private string _serverVersion; + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; set => this._serverVersion = value; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public OracleConnectionInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectionInfo), __connectionInfo); + await eventListener.AssertObjectIsValid(nameof(__connectionInfo), __connectionInfo); + } + } + /// Information for connecting to Oracle server + public partial interface IOracleConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo + { + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// EZConnect or TNSName connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"EZConnect or TNSName connection string.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string DataSource { get; set; } + /// port for server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"port for server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? Port { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; set; } + + } + /// Information for connecting to Oracle server + internal partial interface IOracleConnectionInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal + { + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// EZConnect or TNSName connection string. + string DataSource { get; set; } + /// port for server + int? Port { get; set; } + /// name of the server + string ServerName { get; set; } + /// server version + string ServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.json.cs new file mode 100644 index 000000000000..5fc6d171d82a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleConnectionInfo.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to Oracle server + public partial class OracleConnectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleConnectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OracleConnectionInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal OracleConnectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(json); + {_dataSource = If( json?.PropertyT("dataSource"), out var __jsonDataSource) ? (string)__jsonDataSource : (string)DataSource;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int?)__jsonPort : Port;} + {_authentication = If( json?.PropertyT("authentication"), out var __jsonAuthentication) ? (string)__jsonAuthentication : (string)Authentication;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectionInfo?.ToJson(container, serializationMode); + AddIf( null != (((object)this._dataSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataSource.ToString()) : null, "dataSource" ,container.Add ); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._port) : null, "port" ,container.Add ); + AddIf( null != (((object)this._authentication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authentication.ToString()) : null, "authentication" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.PowerShell.cs new file mode 100644 index 000000000000..7fb61f911b9d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information about an Oracle OCI driver. + [System.ComponentModel.TypeConverter(typeof(OracleOciDriverInfoTypeConverter))] + public partial class OracleOciDriverInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OracleOciDriverInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OracleOciDriverInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OracleOciDriverInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverName = (string) content.GetValueForProperty("DriverName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverName, global::System.Convert.ToString); + } + if (content.Contains("DriverSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverSize = (string) content.GetValueForProperty("DriverSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverSize, global::System.Convert.ToString); + } + if (content.Contains("ArchiveChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).ArchiveChecksum = (string) content.GetValueForProperty("ArchiveChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).ArchiveChecksum, global::System.Convert.ToString); + } + if (content.Contains("OracleChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).OracleChecksum = (string) content.GetValueForProperty("OracleChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).OracleChecksum, global::System.Convert.ToString); + } + if (content.Contains("AssemblyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).AssemblyVersion = (string) content.GetValueForProperty("AssemblyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).AssemblyVersion, global::System.Convert.ToString); + } + if (content.Contains("SupportedOracleVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).SupportedOracleVersion = (string[]) content.GetValueForProperty("SupportedOracleVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).SupportedOracleVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OracleOciDriverInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverName = (string) content.GetValueForProperty("DriverName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverName, global::System.Convert.ToString); + } + if (content.Contains("DriverSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverSize = (string) content.GetValueForProperty("DriverSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).DriverSize, global::System.Convert.ToString); + } + if (content.Contains("ArchiveChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).ArchiveChecksum = (string) content.GetValueForProperty("ArchiveChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).ArchiveChecksum, global::System.Convert.ToString); + } + if (content.Contains("OracleChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).OracleChecksum = (string) content.GetValueForProperty("OracleChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).OracleChecksum, global::System.Convert.ToString); + } + if (content.Contains("AssemblyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).AssemblyVersion = (string) content.GetValueForProperty("AssemblyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).AssemblyVersion, global::System.Convert.ToString); + } + if (content.Contains("SupportedOracleVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).SupportedOracleVersion = (string[]) content.GetValueForProperty("SupportedOracleVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal)this).SupportedOracleVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about an Oracle OCI driver. + [System.ComponentModel.TypeConverter(typeof(OracleOciDriverInfoTypeConverter))] + public partial interface IOracleOciDriverInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.TypeConverter.cs new file mode 100644 index 000000000000..b02b8b788a4f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OracleOciDriverInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OracleOciDriverInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OracleOciDriverInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OracleOciDriverInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.cs new file mode 100644 index 000000000000..bab64441de0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about an Oracle OCI driver. + public partial class OracleOciDriverInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal + { + + /// Backing field for property. + private string _archiveChecksum; + + /// The MD5 Base64 encoded checksum for the driver package. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ArchiveChecksum { get => this._archiveChecksum; } + + /// Backing field for property. + private string _assemblyVersion; + + /// Version listed in the OCI assembly 'oci.dll' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AssemblyVersion { get => this._assemblyVersion; } + + /// Backing field for property. + private string _driverName; + + /// The name of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DriverName { get => this._driverName; } + + /// Backing field for property. + private string _driverSize; + + /// The size in bytes of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DriverSize { get => this._driverSize; } + + /// Internal Acessors for ArchiveChecksum + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal.ArchiveChecksum { get => this._archiveChecksum; set { {_archiveChecksum = value;} } } + + /// Internal Acessors for AssemblyVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal.AssemblyVersion { get => this._assemblyVersion; set { {_assemblyVersion = value;} } } + + /// Internal Acessors for DriverName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal.DriverName { get => this._driverName; set { {_driverName = value;} } } + + /// Internal Acessors for DriverSize + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal.DriverSize { get => this._driverSize; set { {_driverSize = value;} } } + + /// Internal Acessors for OracleChecksum + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal.OracleChecksum { get => this._oracleChecksum; set { {_oracleChecksum = value;} } } + + /// Internal Acessors for SupportedOracleVersion + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfoInternal.SupportedOracleVersion { get => this._supportedOracleVersion; set { {_supportedOracleVersion = value;} } } + + /// Backing field for property. + private string _oracleChecksum; + + /// The checksum for the driver package provided by Oracle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string OracleChecksum { get => this._oracleChecksum; } + + /// Backing field for property. + private string[] _supportedOracleVersion; + + /// + /// List of Oracle database versions supported by this driver. Only major minor of the version is listed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SupportedOracleVersion { get => this._supportedOracleVersion; } + + /// Creates an new instance. + public OracleOciDriverInfo() + { + + } + } + /// Information about an Oracle OCI driver. + public partial interface IOracleOciDriverInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The MD5 Base64 encoded checksum for the driver package. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The MD5 Base64 encoded checksum for the driver package.", + SerializedName = @"archiveChecksum", + PossibleTypes = new [] { typeof(string) })] + string ArchiveChecksum { get; } + /// Version listed in the OCI assembly 'oci.dll' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version listed in the OCI assembly 'oci.dll'", + SerializedName = @"assemblyVersion", + PossibleTypes = new [] { typeof(string) })] + string AssemblyVersion { get; } + /// The name of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the driver package", + SerializedName = @"driverName", + PossibleTypes = new [] { typeof(string) })] + string DriverName { get; } + /// The size in bytes of the driver package + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The size in bytes of the driver package", + SerializedName = @"driverSize", + PossibleTypes = new [] { typeof(string) })] + string DriverSize { get; } + /// The checksum for the driver package provided by Oracle. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The checksum for the driver package provided by Oracle.", + SerializedName = @"oracleChecksum", + PossibleTypes = new [] { typeof(string) })] + string OracleChecksum { get; } + /// + /// List of Oracle database versions supported by this driver. Only major minor of the version is listed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of Oracle database versions supported by this driver. Only major minor of the version is listed.", + SerializedName = @"supportedOracleVersions", + PossibleTypes = new [] { typeof(string) })] + string[] SupportedOracleVersion { get; } + + } + /// Information about an Oracle OCI driver. + internal partial interface IOracleOciDriverInfoInternal + + { + /// The MD5 Base64 encoded checksum for the driver package. + string ArchiveChecksum { get; set; } + /// Version listed in the OCI assembly 'oci.dll' + string AssemblyVersion { get; set; } + /// The name of the driver package + string DriverName { get; set; } + /// The size in bytes of the driver package + string DriverSize { get; set; } + /// The checksum for the driver package provided by Oracle. + string OracleChecksum { get; set; } + /// + /// List of Oracle database versions supported by this driver. Only major minor of the version is listed. + /// + string[] SupportedOracleVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.json.cs new file mode 100644 index 000000000000..7866129cc7db --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OracleOciDriverInfo.json.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information about an Oracle OCI driver. + public partial class OracleOciDriverInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOracleOciDriverInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OracleOciDriverInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal OracleOciDriverInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_driverName = If( json?.PropertyT("driverName"), out var __jsonDriverName) ? (string)__jsonDriverName : (string)DriverName;} + {_driverSize = If( json?.PropertyT("driverSize"), out var __jsonDriverSize) ? (string)__jsonDriverSize : (string)DriverSize;} + {_archiveChecksum = If( json?.PropertyT("archiveChecksum"), out var __jsonArchiveChecksum) ? (string)__jsonArchiveChecksum : (string)ArchiveChecksum;} + {_oracleChecksum = If( json?.PropertyT("oracleChecksum"), out var __jsonOracleChecksum) ? (string)__jsonOracleChecksum : (string)OracleChecksum;} + {_assemblyVersion = If( json?.PropertyT("assemblyVersion"), out var __jsonAssemblyVersion) ? (string)__jsonAssemblyVersion : (string)AssemblyVersion;} + {_supportedOracleVersion = If( json?.PropertyT("supportedOracleVersions"), out var __jsonSupportedOracleVersions) ? If( __jsonSupportedOracleVersions as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SupportedOracleVersion;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._driverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._driverName.ToString()) : null, "driverName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._driverSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._driverSize.ToString()) : null, "driverSize" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._archiveChecksum)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._archiveChecksum.ToString()) : null, "archiveChecksum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._oracleChecksum)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._oracleChecksum.ToString()) : null, "oracleChecksum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._assemblyVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._assemblyVersion.ToString()) : null, "assemblyVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._supportedOracleVersion) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._supportedOracleVersion ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("supportedOracleVersions",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.PowerShell.cs new file mode 100644 index 000000000000..ab4c8dbc7a11 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information of orphaned users on the SQL server database. + [System.ComponentModel.TypeConverter(typeof(OrphanedUserInfoTypeConverter))] + public partial class OrphanedUserInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrphanedUserInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrphanedUserInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrphanedUserInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OrphanedUserInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of orphaned users on the SQL server database. + [System.ComponentModel.TypeConverter(typeof(OrphanedUserInfoTypeConverter))] + public partial interface IOrphanedUserInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.TypeConverter.cs new file mode 100644 index 000000000000..27c557b6b5d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OrphanedUserInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OrphanedUserInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OrphanedUserInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OrphanedUserInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.cs new file mode 100644 index 000000000000..c4e368de76ee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of orphaned users on the SQL server database. + public partial class OrphanedUserInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfoInternal + { + + /// Backing field for property. + private string _databaseName; + + /// Parent database of the user + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// Backing field for property. + private string _name; + + /// Name of the orphaned user + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public OrphanedUserInfo() + { + + } + } + /// Information of orphaned users on the SQL server database. + public partial interface IOrphanedUserInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Parent database of the user + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parent database of the user", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + /// Name of the orphaned user + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the orphaned user", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Information of orphaned users on the SQL server database. + internal partial interface IOrphanedUserInfoInternal + + { + /// Parent database of the user + string DatabaseName { get; set; } + /// Name of the orphaned user + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.json.cs new file mode 100644 index 000000000000..b8f402fee6e2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/OrphanedUserInfo.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of orphaned users on the SQL server database. + public partial class OrphanedUserInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOrphanedUserInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new OrphanedUserInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal OrphanedUserInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.PowerShell.cs new file mode 100644 index 000000000000..3b047bf82fc8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.PowerShell.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information for connecting to PostgreSQL server + [System.ComponentModel.TypeConverter(typeof(PostgreSqlConnectionInfoTypeConverter))] + public partial class PostgreSqlConnectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PostgreSqlConnectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PostgreSqlConnectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PostgreSqlConnectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Port = (int) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerBrandVersion = (string) content.GetValueForProperty("ServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PostgreSqlConnectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Port = (int) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("ServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerBrandVersion = (string) content.GetValueForProperty("ServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).ServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information for connecting to PostgreSQL server + [System.ComponentModel.TypeConverter(typeof(PostgreSqlConnectionInfoTypeConverter))] + public partial interface IPostgreSqlConnectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..b6f1464759ce --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PostgreSqlConnectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PostgreSqlConnectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PostgreSqlConnectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PostgreSqlConnectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.cs new file mode 100644 index 000000000000..023e13997ac0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to PostgreSQL server + public partial class PostgreSqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(); + + /// Backing field for property. + private string _additionalSetting; + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AdditionalSetting { get => this._additionalSetting; set => this._additionalSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? _authentication; + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get => this._authentication; set => this._authentication = value; } + + /// Backing field for property. + private string _dataSource; + + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DataSource { get => this._dataSource; set => this._dataSource = value; } + + /// Backing field for property. + private string _databaseName; + + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// Backing field for property. + private bool? _encryptConnection; + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EncryptConnection { get => this._encryptConnection; set => this._encryptConnection = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password = value ?? null; } + + /// Backing field for property. + private int _port; + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int Port { get => this._port; set => this._port = value; } + + /// Backing field for property. + private string _serverBrandVersion; + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerBrandVersion { get => this._serverBrandVersion; set => this._serverBrandVersion = value; } + + /// Backing field for property. + private string _serverName; + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Backing field for property. + private string _serverVersion; + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; set => this._serverVersion = value; } + + /// Backing field for property. + private bool? _trustServerCertificate; + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? TrustServerCertificate { get => this._trustServerCertificate; set => this._trustServerCertificate = value; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public PostgreSqlConnectionInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectionInfo), __connectionInfo); + await eventListener.AssertObjectIsValid(nameof(__connectionInfo), __connectionInfo); + } + } + /// Information for connecting to PostgreSQL server + public partial interface IPostgreSqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// Data source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source ", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string DataSource { get; set; } + /// Name of the database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the database", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? EncryptConnection { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int Port { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerBrandVersion { get; set; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TrustServerCertificate { get; set; } + + } + /// Information for connecting to PostgreSQL server + internal partial interface IPostgreSqlConnectionInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal + { + /// Additional connection settings + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// Data source + string DataSource { get; set; } + /// Name of the database + string DatabaseName { get; set; } + /// Whether to encrypt the connection + bool? EncryptConnection { get; set; } + /// Port for Server + int Port { get; set; } + /// server brand version + string ServerBrandVersion { get; set; } + /// Name of the server + string ServerName { get; set; } + /// server version + string ServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TrustServerCertificate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.json.cs new file mode 100644 index 000000000000..9ae4793f1f57 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/PostgreSqlConnectionInfo.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to PostgreSQL server + public partial class PostgreSqlConnectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IPostgreSqlConnectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new PostgreSqlConnectionInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal PostgreSqlConnectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(json); + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_dataSource = If( json?.PropertyT("dataSource"), out var __jsonDataSource) ? (string)__jsonDataSource : (string)DataSource;} + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int)__jsonPort : Port;} + {_encryptConnection = If( json?.PropertyT("encryptConnection"), out var __jsonEncryptConnection) ? (bool?)__jsonEncryptConnection : EncryptConnection;} + {_trustServerCertificate = If( json?.PropertyT("trustServerCertificate"), out var __jsonTrustServerCertificate) ? (bool?)__jsonTrustServerCertificate : TrustServerCertificate;} + {_additionalSetting = If( json?.PropertyT("additionalSettings"), out var __jsonAdditionalSettings) ? (string)__jsonAdditionalSettings : (string)AdditionalSetting;} + {_serverBrandVersion = If( json?.PropertyT("serverBrandVersion"), out var __jsonServerBrandVersion) ? (string)__jsonServerBrandVersion : (string)ServerBrandVersion;} + {_authentication = If( json?.PropertyT("authentication"), out var __jsonAuthentication) ? (string)__jsonAuthentication : (string)Authentication;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectionInfo?.ToJson(container, serializationMode); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != (((object)this._dataSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataSource.ToString()) : null, "dataSource" ,container.Add ); + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber(this._port), "port" ,container.Add ); + AddIf( null != this._encryptConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._encryptConnection) : null, "encryptConnection" ,container.Add ); + AddIf( null != this._trustServerCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._trustServerCertificate) : null, "trustServerCertificate" ,container.Add ); + AddIf( null != (((object)this._additionalSetting)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._additionalSetting.ToString()) : null, "additionalSettings" ,container.Add ); + AddIf( null != (((object)this._serverBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverBrandVersion.ToString()) : null, "serverBrandVersion" ,container.Add ); + AddIf( null != (((object)this._authentication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authentication.ToString()) : null, "authentication" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.PowerShell.cs new file mode 100644 index 000000000000..04e588e016bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.PowerShell.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A project resource + [System.ComponentModel.TypeConverter(typeof(ProjectTypeConverter))] + public partial class Project + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Project(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Project(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Project(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureAuthenticationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourcePlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourcePlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) content.GetValueForProperty("SourcePlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourcePlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform.CreateFrom); + } + if (content.Contains("TargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) content.GetValueForProperty("TargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatabasesInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).DatabasesInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]) content.GetValueForProperty("DatabasesInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).DatabasesInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState.CreateFrom); + } + if (content.Contains("AzureAuthenticationInfoApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoApplicationId = (string) content.GetValueForProperty("AzureAuthenticationInfoApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoAppKey = (string) content.GetValueForProperty("AzureAuthenticationInfoAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoTenantId = (string) content.GetValueForProperty("AzureAuthenticationInfoTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAuthenticationInfoIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Project(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureAuthenticationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourcePlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourcePlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) content.GetValueForProperty("SourcePlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourcePlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform.CreateFrom); + } + if (content.Contains("TargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) content.GetValueForProperty("TargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatabasesInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).DatabasesInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]) content.GetValueForProperty("DatabasesInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).DatabasesInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState.CreateFrom); + } + if (content.Contains("AzureAuthenticationInfoApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoApplicationId = (string) content.GetValueForProperty("AzureAuthenticationInfoApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoAppKey = (string) content.GetValueForProperty("AzureAuthenticationInfoAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoTenantId = (string) content.GetValueForProperty("AzureAuthenticationInfoTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAuthenticationInfoIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).AzureAuthenticationInfoIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A project resource + [System.ComponentModel.TypeConverter(typeof(ProjectTypeConverter))] + public partial interface IProject + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.TypeConverter.cs new file mode 100644 index 000000000000..74bd49f97764 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Project.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Project.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Project.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.cs new file mode 100644 index 000000000000..4c8988a50b6d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A project resource + public partial class Project : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource(); + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAuthenticationInfoAppKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoAppKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoAppKey = value ?? null; } + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAuthenticationInfoApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoApplicationId = value ?? null; } + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? AzureAuthenticationInfoIgnoreAzurePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoIgnoreAzurePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoIgnoreAzurePermission = value ?? default(bool); } + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAuthenticationInfoTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfoTenantId = value ?? null; } + + /// UTC Date and time when project was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).CreationTime; } + + /// List of DatabaseInfo + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).DatabasesInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).DatabasesInfo = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _etag; + + /// HTTP strong entity tag value. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for AzureAuthenticationInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal.AzureAuthenticationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).AzureAuthenticationInfo = value; } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal.CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).CreationTime = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal.SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfo = value; } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectInternal.TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfo = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties _property; + + /// Project properties + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectProperties()); set => this._property = value; } + + /// The project's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).ProvisioningState; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfoPassword = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourceConnectionInfoUserName = value ?? null; } + + /// Source platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform? SourcePlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourcePlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).SourcePlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfoPassword = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfoType = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetConnectionInfoUserName = value ?? null; } + + /// Target platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform? TargetPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)Property).TargetPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public Project() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// A project resource + public partial interface IProject : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource + { + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + string AzureAuthenticationInfoAppKey { get; set; } + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string AzureAuthenticationInfoApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureAuthenticationInfoIgnoreAzurePermission { get; set; } + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureAuthenticationInfoTenantId { get; set; } + /// UTC Date and time when project was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC Date and time when project was created", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationTime { get; } + /// List of DatabaseInfo + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of DatabaseInfo", + SerializedName = @"databasesInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get; set; } + /// HTTP strong entity tag value. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// The project's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The project's provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? ProvisioningState { get; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Source platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source platform for the project", + SerializedName = @"sourcePlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform? SourcePlatform { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + /// Target platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target platform for the project", + SerializedName = @"targetPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform? TargetPlatform { get; set; } + + } + /// A project resource + internal partial interface IProjectInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal + { + /// + /// Field that defines the Azure active directory application info, used to connect to the target Azure resource + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureAuthenticationInfo { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + string AzureAuthenticationInfoAppKey { get; set; } + /// Application ID of the Azure Active Directory Application + string AzureAuthenticationInfoApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + bool? AzureAuthenticationInfoIgnoreAzurePermission { get; set; } + /// Tenant id of the customer + string AzureAuthenticationInfoTenantId { get; set; } + /// UTC Date and time when project was created + global::System.DateTime? CreationTime { get; set; } + /// List of DatabaseInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get; set; } + /// HTTP strong entity tag value. This is ignored if submitted. + string Etag { get; set; } + /// Project properties + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties Property { get; set; } + /// The project's provisioning state + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? ProvisioningState { get; set; } + /// Information for connecting to source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo SourceConnectionInfo { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Source platform for the project + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform? SourcePlatform { get; set; } + /// Information for connecting to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo TargetConnectionInfo { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + /// Target platform for the project + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform? TargetPlatform { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.json.cs new file mode 100644 index 000000000000..920eefd21303 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Project.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A project resource + public partial class Project + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new Project(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal Project(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectProperties.FromJson(__jsonProperties) : Property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.PowerShell.cs new file mode 100644 index 000000000000..2c8feac95471 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.PowerShell.cs @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A file resource + [System.ComponentModel.TypeConverter(typeof(ProjectFileTypeConverter))] + public partial class ProjectFile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProjectFile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProjectFile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProjectFile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Extension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Extension = (string) content.GetValueForProperty("Extension",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Extension, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LastModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).LastModified = (global::System.DateTime?) content.GetValueForProperty("LastModified",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).LastModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MediaType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).MediaType = (string) content.GetValueForProperty("MediaType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).MediaType, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Size = (long?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Size, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProjectFile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Extension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Extension = (string) content.GetValueForProperty("Extension",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Extension, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LastModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).LastModified = (global::System.DateTime?) content.GetValueForProperty("LastModified",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).LastModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MediaType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).MediaType = (string) content.GetValueForProperty("MediaType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).MediaType, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Size = (long?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).Size, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A file resource + [System.ComponentModel.TypeConverter(typeof(ProjectFileTypeConverter))] + public partial interface IProjectFile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.TypeConverter.cs new file mode 100644 index 000000000000..2194c4714272 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectFileTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProjectFile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProjectFile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProjectFile.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.cs new file mode 100644 index 000000000000..01c55163960d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A file resource + public partial class ProjectFile : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Resource(); + + /// Backing field for property. + private string _etag; + + /// HTTP strong entity tag value. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string Extension { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).Extension; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).Extension = value ?? null; } + + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FilePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).FilePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).FilePath = value ?? null; } + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Id; } + + /// Modification DateTime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? LastModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).LastModified; } + + /// + /// File content type. This property can be modified to reflect the file content type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string MediaType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).MediaType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).MediaType = value ?? null; } + + /// Internal Acessors for LastModified + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal.LastModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).LastModified; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).LastModified = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFileProperties()); set { {_property = value;} } } + + /// Internal Acessors for Size + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal.Size { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).Size; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).Size = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties _property; + + /// Custom file properties + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFileProperties()); set => this._property = value; } + + /// File size. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? Size { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)Property).Size; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProjectFile() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A file resource + public partial interface IProjectFile : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource + { + /// HTTP strong entity tag value. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.", + SerializedName = @"extension", + PossibleTypes = new [] { typeof(string) })] + string Extension { get; set; } + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative path of this file resource. This property can be set when creating or updating the file resource.", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Modification DateTime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Modification DateTime.", + SerializedName = @"lastModified", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModified { get; } + /// + /// File content type. This property can be modified to reflect the file content type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File content type. This property can be modified to reflect the file content type.", + SerializedName = @"mediaType", + PossibleTypes = new [] { typeof(string) })] + string MediaType { get; set; } + /// File size. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"File size.", + SerializedName = @"size", + PossibleTypes = new [] { typeof(long) })] + long? Size { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// A file resource + internal partial interface IProjectFileInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal + { + /// HTTP strong entity tag value. This is ignored if submitted. + string Etag { get; set; } + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + string Extension { get; set; } + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + string FilePath { get; set; } + /// Modification DateTime. + global::System.DateTime? LastModified { get; set; } + /// + /// File content type. This property can be modified to reflect the file content type. + /// + string MediaType { get; set; } + /// Custom file properties + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties Property { get; set; } + /// File size. + long? Size { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.json.cs new file mode 100644 index 000000000000..16e39750cd30 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFile.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A file resource + public partial class ProjectFile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ProjectFile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ProjectFile(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFileProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.PowerShell.cs new file mode 100644 index 000000000000..0ed61077fea9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Base class for file properties. + [System.ComponentModel.TypeConverter(typeof(ProjectFilePropertiesTypeConverter))] + public partial class ProjectFileProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProjectFileProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProjectFileProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProjectFileProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Extension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Extension = (string) content.GetValueForProperty("Extension",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Extension, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LastModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).LastModified = (global::System.DateTime?) content.GetValueForProperty("LastModified",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).LastModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MediaType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).MediaType = (string) content.GetValueForProperty("MediaType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).MediaType, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Size = (long?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Size, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProjectFileProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Extension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Extension = (string) content.GetValueForProperty("Extension",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Extension, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LastModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).LastModified = (global::System.DateTime?) content.GetValueForProperty("LastModified",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).LastModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MediaType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).MediaType = (string) content.GetValueForProperty("MediaType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).MediaType, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Size = (long?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal)this).Size, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for file properties. + [System.ComponentModel.TypeConverter(typeof(ProjectFilePropertiesTypeConverter))] + public partial interface IProjectFileProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.TypeConverter.cs new file mode 100644 index 000000000000..16bba7478728 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectFilePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProjectFileProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProjectFileProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProjectFileProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.cs new file mode 100644 index 000000000000..4a1757cf002f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for file properties. + public partial class ProjectFileProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal + { + + /// Backing field for property. + private string _extension; + + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Extension { get => this._extension; set => this._extension = value; } + + /// Backing field for property. + private string _filePath; + + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FilePath { get => this._filePath; set => this._filePath = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModified; + + /// Modification DateTime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastModified { get => this._lastModified; } + + /// Backing field for property. + private string _mediaType; + + /// + /// File content type. This property can be modified to reflect the file content type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MediaType { get => this._mediaType; set => this._mediaType = value; } + + /// Internal Acessors for LastModified + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal.LastModified { get => this._lastModified; set { {_lastModified = value;} } } + + /// Internal Acessors for Size + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFilePropertiesInternal.Size { get => this._size; set { {_size = value;} } } + + /// Backing field for property. + private long? _size; + + /// File size. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Size { get => this._size; } + + /// Creates an new instance. + public ProjectFileProperties() + { + + } + } + /// Base class for file properties. + public partial interface IProjectFileProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.", + SerializedName = @"extension", + PossibleTypes = new [] { typeof(string) })] + string Extension { get; set; } + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative path of this file resource. This property can be set when creating or updating the file resource.", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Modification DateTime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Modification DateTime.", + SerializedName = @"lastModified", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModified { get; } + /// + /// File content type. This property can be modified to reflect the file content type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File content type. This property can be modified to reflect the file content type.", + SerializedName = @"mediaType", + PossibleTypes = new [] { typeof(string) })] + string MediaType { get; set; } + /// File size. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"File size.", + SerializedName = @"size", + PossibleTypes = new [] { typeof(long) })] + long? Size { get; } + + } + /// Base class for file properties. + internal partial interface IProjectFilePropertiesInternal + + { + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + string Extension { get; set; } + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + string FilePath { get; set; } + /// Modification DateTime. + global::System.DateTime? LastModified { get; set; } + /// + /// File content type. This property can be modified to reflect the file content type. + /// + string MediaType { get; set; } + /// File size. + long? Size { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.json.cs new file mode 100644 index 000000000000..f899f6beff40 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectFileProperties.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for file properties. + public partial class ProjectFileProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFileProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ProjectFileProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ProjectFileProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_extension = If( json?.PropertyT("extension"), out var __jsonExtension) ? (string)__jsonExtension : (string)Extension;} + {_filePath = If( json?.PropertyT("filePath"), out var __jsonFilePath) ? (string)__jsonFilePath : (string)FilePath;} + {_lastModified = If( json?.PropertyT("lastModified"), out var __jsonLastModified) ? global::System.DateTime.TryParse((string)__jsonLastModified, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedValue) ? __jsonLastModifiedValue : LastModified : LastModified;} + {_mediaType = If( json?.PropertyT("mediaType"), out var __jsonMediaType) ? (string)__jsonMediaType : (string)MediaType;} + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (long?)__jsonSize : Size;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._extension)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._extension.ToString()) : null, "extension" ,container.Add ); + AddIf( null != (((object)this._filePath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._filePath.ToString()) : null, "filePath" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModified ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModified?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModified" ,container.Add ); + } + AddIf( null != (((object)this._mediaType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._mediaType.ToString()) : null, "mediaType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._size ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._size) : null, "size" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.PowerShell.cs new file mode 100644 index 000000000000..dc8773f83661 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// OData page of project resources + [System.ComponentModel.TypeConverter(typeof(ProjectListTypeConverter))] + public partial class ProjectList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProjectList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProjectList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProjectList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProjectList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OData page of project resources + [System.ComponentModel.TypeConverter(typeof(ProjectListTypeConverter))] + public partial interface IProjectList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.TypeConverter.cs new file mode 100644 index 000000000000..49e9f2a2e229 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProjectList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProjectList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProjectList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.cs new file mode 100644 index 000000000000..07ce22f10957 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of project resources + public partial class ProjectList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to load the next page of projects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject[] _value; + + /// List of projects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProjectList() + { + + } + } + /// OData page of project resources + public partial interface IProjectList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// URL to load the next page of projects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to load the next page of projects", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of projects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of projects", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject[] Value { get; set; } + + } + /// OData page of project resources + internal partial interface IProjectListInternal + + { + /// URL to load the next page of projects + string NextLink { get; set; } + /// List of projects + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.json.cs new file mode 100644 index 000000000000..bf61fb0d1612 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of project resources + public partial class ProjectList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ProjectList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ProjectList(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.PowerShell.cs new file mode 100644 index 000000000000..40e6a44051ac --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.PowerShell.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Project-specific properties + [System.ComponentModel.TypeConverter(typeof(ProjectPropertiesTypeConverter))] + public partial class ProjectProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProjectProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProjectProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProjectProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureAuthenticationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureAuthenticationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourcePlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourcePlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) content.GetValueForProperty("SourcePlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourcePlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform.CreateFrom); + } + if (content.Contains("TargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) content.GetValueForProperty("TargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatabasesInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).DatabasesInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]) content.GetValueForProperty("DatabasesInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).DatabasesInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState.CreateFrom); + } + if (content.Contains("AzureAuthenticationInfoApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoApplicationId = (string) content.GetValueForProperty("AzureAuthenticationInfoApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoAppKey = (string) content.GetValueForProperty("AzureAuthenticationInfoAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoTenantId = (string) content.GetValueForProperty("AzureAuthenticationInfoTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAuthenticationInfoIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProjectProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureAuthenticationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureAuthenticationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourcePlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourcePlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) content.GetValueForProperty("SourcePlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourcePlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform.CreateFrom); + } + if (content.Contains("TargetPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) content.GetValueForProperty("TargetPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatabasesInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).DatabasesInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[]) content.GetValueForProperty("DatabasesInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).DatabasesInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState.CreateFrom); + } + if (content.Contains("AzureAuthenticationInfoApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoApplicationId = (string) content.GetValueForProperty("AzureAuthenticationInfoApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoAppKey = (string) content.GetValueForProperty("AzureAuthenticationInfoAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoTenantId = (string) content.GetValueForProperty("AzureAuthenticationInfoTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAuthenticationInfoIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAuthenticationInfoIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).AzureAuthenticationInfoIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Project-specific properties + [System.ComponentModel.TypeConverter(typeof(ProjectPropertiesTypeConverter))] + public partial interface IProjectProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.TypeConverter.cs new file mode 100644 index 000000000000..9d495eeeba34 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProjectProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProjectProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProjectProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.cs new file mode 100644 index 000000000000..bb56f720ee65 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Project-specific properties + public partial class ProjectProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp _azureAuthenticationInfo; + + /// + /// Field that defines the Azure active directory application info, used to connect to the target Azure resource + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureAuthenticationInfo { get => (this._azureAuthenticationInfo = this._azureAuthenticationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp()); set => this._azureAuthenticationInfo = value; } + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAuthenticationInfoAppKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).AppKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).AppKey = value ?? null; } + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAuthenticationInfoApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).ApplicationId = value ?? null; } + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? AzureAuthenticationInfoIgnoreAzurePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).IgnoreAzurePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).IgnoreAzurePermission = value ?? default(bool); } + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAuthenticationInfoTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureAuthenticationInfo).TenantId = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _creationTime; + + /// UTC Date and time when project was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? CreationTime { get => this._creationTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] _databasesInfo; + + /// List of DatabaseInfo + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get => this._databasesInfo; set => this._databasesInfo = value; } + + /// Internal Acessors for AzureAuthenticationInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal.AzureAuthenticationInfo { get => (this._azureAuthenticationInfo = this._azureAuthenticationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp()); set { {_azureAuthenticationInfo = value;} } } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectPropertiesInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? _provisioningState; + + /// The project's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo _sourceConnectionInfo; + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform _sourcePlatform; + + /// Source platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform SourcePlatform { get => this._sourcePlatform; set => this._sourcePlatform = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo _targetConnectionInfo; + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ?? null; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform _targetPlatform; + + /// Target platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform TargetPlatform { get => this._targetPlatform; set => this._targetPlatform = value; } + + /// Creates an new instance. + public ProjectProperties() + { + + } + } + /// Project-specific properties + public partial interface IProjectProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + string AzureAuthenticationInfoAppKey { get; set; } + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string AzureAuthenticationInfoApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureAuthenticationInfoIgnoreAzurePermission { get; set; } + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureAuthenticationInfoTenantId { get; set; } + /// UTC Date and time when project was created + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC Date and time when project was created", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationTime { get; } + /// List of DatabaseInfo + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of DatabaseInfo", + SerializedName = @"databasesInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get; set; } + /// The project's provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The project's provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? ProvisioningState { get; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Source platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Source platform for the project", + SerializedName = @"sourcePlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform SourcePlatform { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + /// Target platform for the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Target platform for the project", + SerializedName = @"targetPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform TargetPlatform { get; set; } + + } + /// Project-specific properties + internal partial interface IProjectPropertiesInternal + + { + /// + /// Field that defines the Azure active directory application info, used to connect to the target Azure resource + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureAuthenticationInfo { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + string AzureAuthenticationInfoAppKey { get; set; } + /// Application ID of the Azure Active Directory Application + string AzureAuthenticationInfoApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + bool? AzureAuthenticationInfoIgnoreAzurePermission { get; set; } + /// Tenant id of the customer + string AzureAuthenticationInfoTenantId { get; set; } + /// UTC Date and time when project was created + global::System.DateTime? CreationTime { get; set; } + /// List of DatabaseInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get; set; } + /// The project's provisioning state + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState? ProvisioningState { get; set; } + /// Information for connecting to source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo SourceConnectionInfo { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Source platform for the project + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform SourcePlatform { get; set; } + /// Information for connecting to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo TargetConnectionInfo { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + /// Target platform for the project + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform TargetPlatform { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.json.cs new file mode 100644 index 000000000000..b8fbe1ef7d76 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectProperties.json.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Project-specific properties + public partial class ProjectProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ProjectProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ProjectProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureAuthenticationInfo = If( json?.PropertyT("azureAuthenticationInfo"), out var __jsonAzureAuthenticationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp.FromJson(__jsonAzureAuthenticationInfo) : AzureAuthenticationInfo;} + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_sourcePlatform = If( json?.PropertyT("sourcePlatform"), out var __jsonSourcePlatform) ? (string)__jsonSourcePlatform : (string)SourcePlatform;} + {_targetPlatform = If( json?.PropertyT("targetPlatform"), out var __jsonTargetPlatform) ? (string)__jsonTargetPlatform : (string)TargetPlatform;} + {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? global::System.DateTime.TryParse((string)__jsonCreationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreationTimeValue) ? __jsonCreationTimeValue : CreationTime : CreationTime;} + {_databasesInfo = If( json?.PropertyT("databasesInfo"), out var __jsonDatabasesInfo) ? If( __jsonDatabasesInfo as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseInfo.FromJson(__u) )) ))() : null : DatabasesInfo;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._azureAuthenticationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._azureAuthenticationInfo.ToJson(null,serializationMode) : null, "azureAuthenticationInfo" ,container.Add ); + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != (((object)this._sourcePlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourcePlatform.ToString()) : null, "sourcePlatform" ,container.Add ); + AddIf( null != (((object)this._targetPlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetPlatform.ToString()) : null, "targetPlatform" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._creationTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._creationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "creationTime" ,container.Add ); + } + if (null != this._databasesInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._databasesInfo ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("databasesInfo",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.PowerShell.cs new file mode 100644 index 000000000000..be746fd562a2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.PowerShell.cs @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A task resource + [System.ComponentModel.TypeConverter(typeof(ProjectTaskTypeConverter))] + public partial class ProjectTask + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProjectTask(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProjectTask(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProjectTask(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProjectTask(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A task resource + [System.ComponentModel.TypeConverter(typeof(ProjectTaskTypeConverter))] + public partial interface IProjectTask + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.TypeConverter.cs new file mode 100644 index 000000000000..262709f3384d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectTaskTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProjectTask.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProjectTask.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProjectTask.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.cs new file mode 100644 index 000000000000..0caffffd0177 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A task resource + public partial class ProjectTask : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Resource(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).Error; } + + /// Backing field for property. + private string _etag; + + /// HTTP strong entity tag value. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties()); set { {_property = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).State = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties _property; + + /// Custom task properties + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties()); set => this._property = value; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).State; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType? TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)Property).TaskType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType)""); } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProjectTask() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A task resource + public partial interface IProjectTask : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource + { + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get; set; } + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Array of command properties.", + SerializedName = @"commands", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get; } + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Array of errors. This is ignored if submitted.", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get; } + /// HTTP strong entity tag value. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The state of the task. This is ignored if submitted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType? TaskType { get; set; } + + } + /// A task resource + internal partial interface IProjectTaskInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal + { + /// Key value pairs of client data to attach meta data information to task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get; set; } + /// Array of command properties. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get; set; } + /// Array of errors. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get; set; } + /// HTTP strong entity tag value. This is ignored if submitted. + string Etag { get; set; } + /// Custom task properties + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties Property { get; set; } + /// The state of the task. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Task type. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType? TaskType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.json.cs new file mode 100644 index 000000000000..94b3916408bd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTask.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A task resource + public partial class ProjectTask + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ProjectTask(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ProjectTask(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..bc41c9c5bb2d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. + /// + [System.ComponentModel.TypeConverter(typeof(ProjectTaskPropertiesTypeConverter))] + public partial class ProjectTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProjectTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProjectTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProjectTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProjectTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. + [System.ComponentModel.TypeConverter(typeof(ProjectTaskPropertiesTypeConverter))] + public partial interface IProjectTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..9d20f44b9a0b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProjectTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProjectTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProjectTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.cs new file mode 100644 index 000000000000..d977e925f5ab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. + /// + public partial class ProjectTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData _clientData; + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => (this._clientData = this._clientData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientData()); set => this._clientData = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] _command; + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => this._command; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] _error; + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => this._error; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => this._command; set { {_command = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => this._error; set { {_error = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => this._state; set { {_state = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? _state; + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => this._state; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType _taskType; + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => this._taskType; set => this._taskType = value; } + + /// Creates an new instance. + public ProjectTaskProperties() + { + + } + } + /// Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. + public partial interface IProjectTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get; set; } + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Array of command properties.", + SerializedName = @"commands", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get; } + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Array of errors. This is ignored if submitted.", + SerializedName = @"errors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get; } + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The state of the task. This is ignored if submitted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get; } + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get; set; } + + } + /// Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. + internal partial interface IProjectTaskPropertiesInternal + + { + /// Key value pairs of client data to attach meta data information to task + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get; set; } + /// Array of command properties. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get; set; } + /// Array of errors. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get; set; } + /// The state of the task. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get; set; } + /// Task type. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.json.cs new file mode 100644 index 000000000000..d059de55d376 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskProperties.json.cs @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. + /// + public partial class ProjectTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("taskType") ) + { + case "MigrateSchemaSqlServerSqlDb": + { + return new MigrateSchemaSqlServerSqlDbTaskProperties(json); + } + case "Service.Check.OCI": + { + return new CheckOciDriverTaskProperties(json); + } + case "Service.Upload.OCI": + { + return new UploadOciDriverTaskProperties(json); + } + case "Service.Install.OCI": + { + return new InstallOciDriverTaskProperties(json); + } + case "Connect.MongoDb": + { + return new ConnectToMongoDbTaskProperties(json); + } + case "ConnectToSource.SqlServer": + { + return new ConnectToSourceSqlServerTaskProperties(json); + } + case "ConnectToSource.SqlServer.Sync": + { + return new ConnectToSourceSqlServerSyncTaskProperties(json); + } + case "ConnectToSource.PostgreSql.Sync": + { + return new ConnectToSourcePostgreSqlSyncTaskProperties(json); + } + case "ConnectToSource.MySql": + { + return new ConnectToSourceMySqlTaskProperties(json); + } + case "ConnectToSource.Oracle.Sync": + { + return new ConnectToSourceOracleSyncTaskProperties(json); + } + case "ConnectToTarget.SqlDb": + { + return new ConnectToTargetSqlDbTaskProperties(json); + } + case "ConnectToTarget.SqlDb.Sync": + { + return new ConnectToTargetSqlDbSyncTaskProperties(json); + } + case "ConnectToTarget.AzureDbForPostgreSql.Sync": + { + return new ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(json); + } + case "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync": + { + return new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(json); + } + case "GetUserTables.Sql": + { + return new GetUserTablesSqlTaskProperties(json); + } + case "GetUserTables.AzureSqlDb.Sync": + { + return new GetUserTablesSqlSyncTaskProperties(json); + } + case "GetUserTablesOracle": + { + return new GetUserTablesOracleTaskProperties(json); + } + case "GetUserTablesPostgreSql": + { + return new GetUserTablesPostgreSqlTaskProperties(json); + } + case "GetUserTablesMySql": + { + return new GetUserTablesMySqlTaskProperties(json); + } + case "ConnectToTarget.AzureSqlDbMI": + { + return new ConnectToTargetSqlMiTaskProperties(json); + } + case "ConnectToTarget.AzureSqlDbMI.Sync.LRS": + { + return new ConnectToTargetSqlMiSyncTaskProperties(json); + } + case "ConnectToTarget.AzureDbForMySql": + { + return new ConnectToTargetAzureDbForMySqlTaskProperties(json); + } + case "Migrate.MongoDb": + { + return new MigrateMongoDbTaskProperties(json); + } + case "Migrate.SqlServer.AzureSqlDbMI": + { + return new MigrateSqlServerSqlMiTaskProperties(json); + } + case "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS": + { + return new MigrateSqlServerSqlMiSyncTaskProperties(json); + } + case "Migrate.SqlServer.SqlDb": + { + return new MigrateSqlServerSqlDbTaskProperties(json); + } + case "Migrate.SqlServer.AzureSqlDb.Sync": + { + return new MigrateSqlServerSqlDbSyncTaskProperties(json); + } + case "Migrate.MySql.AzureDbForMySql.Sync": + { + return new MigrateMySqlAzureDbForMySqlSyncTaskProperties(json); + } + case "Migrate.MySql.AzureDbForMySql": + { + return new MigrateMySqlAzureDbForMySqlOfflineTaskProperties(json); + } + case "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2": + { + return new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(json); + } + case "Migrate.Oracle.AzureDbForPostgreSql.Sync": + { + return new MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(json); + } + case "ValidateMigrationInput.SqlServer.SqlDb.Sync": + { + return new ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(json); + } + case "ValidateMigrationInput.SqlServer.AzureSqlDbMI": + { + return new ValidateMigrationInputSqlServerSqlMiTaskProperties(json); + } + case "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS": + { + return new ValidateMigrationInputSqlServerSqlMiSyncTaskProperties(json); + } + case "Validate.MongoDb": + { + return new ValidateMongoDbTaskProperties(json); + } + case "Validate.Oracle.AzureDbPostgreSql.Sync": + { + return new ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(json); + } + case "GetTDECertificates.Sql": + { + return new GetTdeCertificatesSqlTaskProperties(json); + } + case "Migrate.Ssis": + { + return new MigrateSsisTaskProperties(json); + } + } + return new ProjectTaskProperties(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ProjectTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_taskType = If( json?.PropertyT("taskType"), out var __jsonTaskType) ? (string)__jsonTaskType : (string)TaskType;} + {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? If( __jsonErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataError.FromJson(__u) )) ))() : null : Error;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_command = If( json?.PropertyT("commands"), out var __jsonCommands) ? If( __jsonCommands as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties.FromJson(__p) )) ))() : null : Command;} + {_clientData = If( json?.PropertyT("clientData"), out var __jsonClientData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientData.FromJson(__jsonClientData) : ClientData;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._taskType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskType.ToString()) : null, "taskType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._error) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._error ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("errors",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._command) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._command ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("commands",__r); + } + } + AddIf( null != this._clientData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._clientData.ToJson(null,serializationMode) : null, "clientData" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.PowerShell.cs new file mode 100644 index 000000000000..d38213aed5bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Key value pairs of client data to attach meta data information to task + [System.ComponentModel.TypeConverter(typeof(ProjectTaskPropertiesClientDataTypeConverter))] + public partial class ProjectTaskPropertiesClientData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProjectTaskPropertiesClientData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProjectTaskPropertiesClientData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProjectTaskPropertiesClientData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProjectTaskPropertiesClientData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Key value pairs of client data to attach meta data information to task + [System.ComponentModel.TypeConverter(typeof(ProjectTaskPropertiesClientDataTypeConverter))] + public partial interface IProjectTaskPropertiesClientData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.TypeConverter.cs new file mode 100644 index 000000000000..9f7bc68b14bb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProjectTaskPropertiesClientDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProjectTaskPropertiesClientData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProjectTaskPropertiesClientData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProjectTaskPropertiesClientData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.cs new file mode 100644 index 000000000000..8e67bbe9f54a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Key value pairs of client data to attach meta data information to task + public partial class ProjectTaskPropertiesClientData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientDataInternal + { + + /// Creates an new instance. + public ProjectTaskPropertiesClientData() + { + + } + } + /// Key value pairs of client data to attach meta data information to task + public partial interface IProjectTaskPropertiesClientData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Key value pairs of client data to attach meta data information to task + internal partial interface IProjectTaskPropertiesClientDataInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.dictionary.cs new file mode 100644 index 000000000000..c898bde54bea --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class ProjectTaskPropertiesClientData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientData source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.json.cs new file mode 100644 index 000000000000..6ed057279cd0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProjectTaskPropertiesClientData.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Key value pairs of client data to attach meta data information to task + public partial class ProjectTaskPropertiesClientData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ProjectTaskPropertiesClientData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ProjectTaskPropertiesClientData(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.PowerShell.cs new file mode 100644 index 000000000000..48054483ac4a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial class ProxyResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProxyResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProxyResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProxyResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProxyResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial interface IProxyResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.TypeConverter.cs new file mode 100644 index 000000000000..07736c2d383f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProxyResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProxyResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.cs new file mode 100644 index 000000000000..57152b02332b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class ProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal + { + + /// Backing field for property. + private string _id; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ProxyResource() + { + + } + } + public partial interface IProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + internal partial interface IProxyResourceInternal + + { + string Id { get; set; } + + string Name { get; set; } + + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.json.cs new file mode 100644 index 000000000000..0f4db4df8ff4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ProxyResource.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class ProxyResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.PowerShell.cs new file mode 100644 index 000000000000..9f137f26ffcc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.PowerShell.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Results for query analysis comparison between the source and target + [System.ComponentModel.TypeConverter(typeof(QueryAnalysisValidationResultTypeConverter))] + public partial class QueryAnalysisValidationResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryAnalysisValidationResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryAnalysisValidationResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryAnalysisValidationResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult) content.GetValueForProperty("QueryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResultTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationErrorSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("ValidationErrorSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("QueryResultSourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultSourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultSourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultSourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultTargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultTargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultTargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultTargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultQueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultQueryText = (string) content.GetValueForProperty("QueryResultQueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultQueryText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultStatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultStatementsInBatch = (long?) content.GetValueForProperty("QueryResultStatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultStatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ValidationErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorText = (string) content.GetValueForProperty("ValidationErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorText, global::System.Convert.ToString); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueryAnalysisValidationResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueryResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult) content.GetValueForProperty("QueryResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResultTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationErrorSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("ValidationErrorSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("QueryResultSourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultSourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultSourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultSourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultTargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultTargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("QueryResultTargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultTargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryResultQueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultQueryText = (string) content.GetValueForProperty("QueryResultQueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultQueryText, global::System.Convert.ToString); + } + if (content.Contains("QueryResultStatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultStatementsInBatch = (long?) content.GetValueForProperty("QueryResultStatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).QueryResultStatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ValidationErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorText = (string) content.GetValueForProperty("ValidationErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).ValidationErrorText, global::System.Convert.ToString); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Results for query analysis comparison between the source and target + [System.ComponentModel.TypeConverter(typeof(QueryAnalysisValidationResultTypeConverter))] + public partial interface IQueryAnalysisValidationResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.TypeConverter.cs new file mode 100644 index 000000000000..a792f898a665 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryAnalysisValidationResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryAnalysisValidationResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryAnalysisValidationResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryAnalysisValidationResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.cs new file mode 100644 index 000000000000..0b2ebd3fdcf8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Results for query analysis comparison between the source and target + public partial class QueryAnalysisValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal + { + + /// Internal Acessors for QueryResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal.QueryResult { get => (this._queryResult = this._queryResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResult()); set { {_queryResult = value;} } } + + /// Internal Acessors for QueryResultSourceResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal.QueryResultSourceResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResult = value; } + + /// Internal Acessors for QueryResultTargetResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal.QueryResultTargetResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResult = value; } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResultInternal.ValidationError { get => (this._validationError = this._validationError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError()); set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult _queryResult; + + /// List of queries executed and it's execution results in source and target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult QueryResult { get => (this._queryResult = this._queryResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResult()); set => this._queryResult = value; } + + /// Query text retrieved from the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string QueryResultQueryText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).QueryText; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).QueryText = value ?? null; } + + /// Total no. of statements in the batch + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? QueryResultStatementsInBatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).StatementsInBatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).StatementsInBatch = value ?? default(long); } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? SourceResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultCpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultCpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? SourceResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? SourceResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultHasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultHasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] SourceResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultSqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultSqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultWaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).SourceResultWaitStat = value ?? null /* model class */; } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? TargetResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultCpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultCpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? TargetResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? TargetResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultHasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultHasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] TargetResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultSqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultSqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultWaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)QueryResult).TargetResultWaitStat = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError _validationError; + + /// Errors that are part of the execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError ValidationError { get => (this._validationError = this._validationError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError()); set => this._validationError = value; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Severity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ValidationErrorText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Text = value ?? null; } + + /// Creates an new instance. + public QueryAnalysisValidationResult() + { + + } + } + /// Results for query analysis comparison between the source and target + public partial interface IQueryAnalysisValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Query text retrieved from the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query text retrieved from the source server", + SerializedName = @"queryText", + PossibleTypes = new [] { typeof(string) })] + string QueryResultQueryText { get; set; } + /// Total no. of statements in the batch + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total no. of statements in the batch", + SerializedName = @"statementsInBatch", + PossibleTypes = new [] { typeof(long) })] + long? QueryResultStatementsInBatch { get; set; } + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CPU Time in millisecond(s) for the query execution", + SerializedName = @"cpuTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? SourceResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken in millisecond(s) for executing the query", + SerializedName = @"elapsedTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? SourceResultElapsedTimeMS { get; set; } + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"No. of query executions", + SerializedName = @"executionCount", + PossibleTypes = new [] { typeof(long) })] + long? SourceResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the query resulted in an error", + SerializedName = @"hasErrors", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceResultHasError { get; set; } + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sql Errors", + SerializedName = @"sqlErrors", + PossibleTypes = new [] { typeof(string) })] + string[] SourceResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of sql query execution wait types and the respective statistics", + SerializedName = @"waitStats", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get; set; } + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CPU Time in millisecond(s) for the query execution", + SerializedName = @"cpuTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? TargetResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken in millisecond(s) for executing the query", + SerializedName = @"elapsedTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? TargetResultElapsedTimeMS { get; set; } + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"No. of query executions", + SerializedName = @"executionCount", + PossibleTypes = new [] { typeof(long) })] + long? TargetResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the query resulted in an error", + SerializedName = @"hasErrors", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetResultHasError { get; set; } + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sql Errors", + SerializedName = @"sqlErrors", + PossibleTypes = new [] { typeof(string) })] + string[] TargetResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of sql query execution wait types and the respective statistics", + SerializedName = @"waitStats", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get; set; } + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the error", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get; set; } + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Text", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string ValidationErrorText { get; set; } + + } + /// Results for query analysis comparison between the source and target + internal partial interface IQueryAnalysisValidationResultInternal + + { + /// List of queries executed and it's execution results in source and target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult QueryResult { get; set; } + /// Query text retrieved from the source server + string QueryResultQueryText { get; set; } + /// Query analysis result from the source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics QueryResultSourceResult { get; set; } + /// Total no. of statements in the batch + long? QueryResultStatementsInBatch { get; set; } + /// Query analysis result from the target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics QueryResultTargetResult { get; set; } + /// CPU Time in millisecond(s) for the query execution + float? SourceResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + float? SourceResultElapsedTimeMS { get; set; } + /// No. of query executions + long? SourceResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + bool? SourceResultHasError { get; set; } + /// List of sql Errors + string[] SourceResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get; set; } + /// CPU Time in millisecond(s) for the query execution + float? TargetResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + float? TargetResultElapsedTimeMS { get; set; } + /// No. of query executions + long? TargetResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + bool? TargetResultHasError { get; set; } + /// List of sql Errors + string[] TargetResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get; set; } + /// Errors that are part of the execution + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError ValidationError { get; set; } + /// Severity of the error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get; set; } + /// Error Text + string ValidationErrorText { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.json.cs new file mode 100644 index 000000000000..728b9baa7f9d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryAnalysisValidationResult.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Results for query analysis comparison between the source and target + public partial class QueryAnalysisValidationResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryAnalysisValidationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new QueryAnalysisValidationResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal QueryAnalysisValidationResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_queryResult = If( json?.PropertyT("queryResults"), out var __jsonQueryResults) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QueryExecutionResult.FromJson(__jsonQueryResults) : QueryResult;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError.FromJson(__jsonValidationErrors) : ValidationError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._queryResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._queryResult.ToJson(null,serializationMode) : null, "queryResults" ,container.Add ); + AddIf( null != this._validationError ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._validationError.ToJson(null,serializationMode) : null, "validationErrors" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.PowerShell.cs new file mode 100644 index 000000000000..4caa8f777495 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.PowerShell.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes query analysis results for execution in source and target + [System.ComponentModel.TypeConverter(typeof(QueryExecutionResultTypeConverter))] + public partial class QueryExecutionResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryExecutionResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryExecutionResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryExecutionResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("SourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("TargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).QueryText = (string) content.GetValueForProperty("QueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).QueryText, global::System.Convert.ToString); + } + if (content.Contains("StatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).StatementsInBatch = (long?) content.GetValueForProperty("StatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).StatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueryExecutionResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("SourceResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResult = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics) content.GetValueForProperty("TargetResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResult, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsTypeConverter.ConvertFrom); + } + if (content.Contains("QueryText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).QueryText = (string) content.GetValueForProperty("QueryText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).QueryText, global::System.Convert.ToString); + } + if (content.Contains("StatementsInBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).StatementsInBatch = (long?) content.GetValueForProperty("StatementsInBatch",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).StatementsInBatch, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultExecutionCount = (long?) content.GetValueForProperty("SourceResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultCpuTimeMS = (float?) content.GetValueForProperty("SourceResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultElapsedTimeMS = (float?) content.GetValueForProperty("SourceResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SourceResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("SourceResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("SourceResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultHasError = (bool?) content.GetValueForProperty("SourceResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultSqlError = (string[]) content.GetValueForProperty("SourceResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).SourceResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetResultExecutionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultExecutionCount = (long?) content.GetValueForProperty("TargetResultExecutionCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultExecutionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TargetResultCpuTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultCpuTimeMS = (float?) content.GetValueForProperty("TargetResultCpuTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultCpuTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultElapsedTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultElapsedTimeMS = (float?) content.GetValueForProperty("TargetResultElapsedTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultElapsedTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TargetResultWaitStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultWaitStat = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) content.GetValueForProperty("TargetResultWaitStat",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultWaitStat, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatisticsWaitStatsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetResultHasError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultHasError = (bool?) content.GetValueForProperty("TargetResultHasError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultHasError, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetResultSqlError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultSqlError = (string[]) content.GetValueForProperty("TargetResultSqlError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal)this).TargetResultSqlError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes query analysis results for execution in source and target + [System.ComponentModel.TypeConverter(typeof(QueryExecutionResultTypeConverter))] + public partial interface IQueryExecutionResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.TypeConverter.cs new file mode 100644 index 000000000000..a9efb0e89de6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryExecutionResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryExecutionResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryExecutionResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryExecutionResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.cs new file mode 100644 index 000000000000..2b3d127c67f5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.cs @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes query analysis results for execution in source and target + public partial class QueryExecutionResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal + { + + /// Internal Acessors for SourceResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal.SourceResult { get => (this._sourceResult = this._sourceResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics()); set { {_sourceResult = value;} } } + + /// Internal Acessors for TargetResult + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResultInternal.TargetResult { get => (this._targetResult = this._targetResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics()); set { {_targetResult = value;} } } + + /// Backing field for property. + private string _queryText; + + /// Query text retrieved from the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string QueryText { get => this._queryText; set => this._queryText = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics _sourceResult; + + /// Query analysis result from the source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics SourceResult { get => (this._sourceResult = this._sourceResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics()); set => this._sourceResult = value; } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? SourceResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).CpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).CpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? SourceResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).ElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).ElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? SourceResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).ExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).ExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).HasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).HasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] SourceResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).SqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).SqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).WaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)SourceResult).WaitStat = value ?? null /* model class */; } + + /// Backing field for property. + private long? _statementsInBatch; + + /// Total no. of statements in the batch + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? StatementsInBatch { get => this._statementsInBatch; set => this._statementsInBatch = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics _targetResult; + + /// Query analysis result from the target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics TargetResult { get => (this._targetResult = this._targetResult ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics()); set => this._targetResult = value; } + + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? TargetResultCpuTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).CpuTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).CpuTimeMS = value ?? default(float); } + + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public float? TargetResultElapsedTimeMS { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).ElapsedTimeMS; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).ElapsedTimeMS = value ?? default(float); } + + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? TargetResultExecutionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).ExecutionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).ExecutionCount = value ?? default(long); } + + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetResultHasError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).HasError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).HasError = value ?? default(bool); } + + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] TargetResultSqlError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).SqlError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).SqlError = value ?? null /* arrayOf */; } + + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).WaitStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsInternal)TargetResult).WaitStat = value ?? null /* model class */; } + + /// Creates an new instance. + public QueryExecutionResult() + { + + } + } + /// Describes query analysis results for execution in source and target + public partial interface IQueryExecutionResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Query text retrieved from the source server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query text retrieved from the source server", + SerializedName = @"queryText", + PossibleTypes = new [] { typeof(string) })] + string QueryText { get; set; } + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CPU Time in millisecond(s) for the query execution", + SerializedName = @"cpuTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? SourceResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken in millisecond(s) for executing the query", + SerializedName = @"elapsedTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? SourceResultElapsedTimeMS { get; set; } + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"No. of query executions", + SerializedName = @"executionCount", + PossibleTypes = new [] { typeof(long) })] + long? SourceResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the query resulted in an error", + SerializedName = @"hasErrors", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceResultHasError { get; set; } + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sql Errors", + SerializedName = @"sqlErrors", + PossibleTypes = new [] { typeof(string) })] + string[] SourceResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of sql query execution wait types and the respective statistics", + SerializedName = @"waitStats", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get; set; } + /// Total no. of statements in the batch + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total no. of statements in the batch", + SerializedName = @"statementsInBatch", + PossibleTypes = new [] { typeof(long) })] + long? StatementsInBatch { get; set; } + /// CPU Time in millisecond(s) for the query execution + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CPU Time in millisecond(s) for the query execution", + SerializedName = @"cpuTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? TargetResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken in millisecond(s) for executing the query", + SerializedName = @"elapsedTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? TargetResultElapsedTimeMS { get; set; } + /// No. of query executions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"No. of query executions", + SerializedName = @"executionCount", + PossibleTypes = new [] { typeof(long) })] + long? TargetResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the query resulted in an error", + SerializedName = @"hasErrors", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetResultHasError { get; set; } + /// List of sql Errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sql Errors", + SerializedName = @"sqlErrors", + PossibleTypes = new [] { typeof(string) })] + string[] TargetResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of sql query execution wait types and the respective statistics", + SerializedName = @"waitStats", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get; set; } + + } + /// Describes query analysis results for execution in source and target + internal partial interface IQueryExecutionResultInternal + + { + /// Query text retrieved from the source server + string QueryText { get; set; } + /// Query analysis result from the source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics SourceResult { get; set; } + /// CPU Time in millisecond(s) for the query execution + float? SourceResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + float? SourceResultElapsedTimeMS { get; set; } + /// No. of query executions + long? SourceResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + bool? SourceResultHasError { get; set; } + /// List of sql Errors + string[] SourceResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats SourceResultWaitStat { get; set; } + /// Total no. of statements in the batch + long? StatementsInBatch { get; set; } + /// Query analysis result from the target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatistics TargetResult { get; set; } + /// CPU Time in millisecond(s) for the query execution + float? TargetResultCpuTimeMS { get; set; } + /// Time taken in millisecond(s) for executing the query + float? TargetResultElapsedTimeMS { get; set; } + /// No. of query executions + long? TargetResultExecutionCount { get; set; } + /// Indicates whether the query resulted in an error + bool? TargetResultHasError { get; set; } + /// List of sql Errors + string[] TargetResultSqlError { get; set; } + /// Dictionary of sql query execution wait types and the respective statistics + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IExecutionStatisticsWaitStats TargetResultWaitStat { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.json.cs new file mode 100644 index 000000000000..494219f30824 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QueryExecutionResult.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes query analysis results for execution in source and target + public partial class QueryExecutionResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQueryExecutionResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new QueryExecutionResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal QueryExecutionResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceResult = If( json?.PropertyT("sourceResult"), out var __jsonSourceResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics.FromJson(__jsonSourceResult) : SourceResult;} + {_targetResult = If( json?.PropertyT("targetResult"), out var __jsonTargetResult) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ExecutionStatistics.FromJson(__jsonTargetResult) : TargetResult;} + {_queryText = If( json?.PropertyT("queryText"), out var __jsonQueryText) ? (string)__jsonQueryText : (string)QueryText;} + {_statementsInBatch = If( json?.PropertyT("statementsInBatch"), out var __jsonStatementsInBatch) ? (long?)__jsonStatementsInBatch : StatementsInBatch;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceResult.ToJson(null,serializationMode) : null, "sourceResult" ,container.Add ); + AddIf( null != this._targetResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetResult.ToJson(null,serializationMode) : null, "targetResult" ,container.Add ); + AddIf( null != (((object)this._queryText)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._queryText.ToString()) : null, "queryText" ,container.Add ); + AddIf( null != this._statementsInBatch ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._statementsInBatch) : null, "statementsInBatch" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.PowerShell.cs new file mode 100644 index 000000000000..aa9615a21f93 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes a quota for or usage details about a resource + [System.ComponentModel.TypeConverter(typeof(QuotaTypeConverter))] + public partial class Quota + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Quota(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Quota(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Quota(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaNameTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).CurrentValue = (double?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).CurrentValue, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Limit = (double?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Limit, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Quota(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaNameTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).CurrentValue = (double?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).CurrentValue, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Limit = (double?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Limit, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal)this).NameValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes a quota for or usage details about a resource + [System.ComponentModel.TypeConverter(typeof(QuotaTypeConverter))] + public partial interface IQuota + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.TypeConverter.cs new file mode 100644 index 000000000000..5c423443f43c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QuotaTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Quota.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Quota.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Quota.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.cs new file mode 100644 index 000000000000..64ef00a82312 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a quota for or usage details about a resource + public partial class Quota : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal + { + + /// Backing field for property. + private double? _currentValue; + + /// + /// The current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? CurrentValue { get => this._currentValue; set => this._currentValue = value; } + + /// Backing field for property. + private string _id; + + /// The resource ID of the quota object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private double? _limit; + + /// + /// The maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? Limit { get => this._limit; set => this._limit = value; } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaName()); set { {_name = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName _name; + + /// The name of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaName()); set => this._name = value; } + + /// The localized name of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)Name).LocalizedValue = value ?? null; } + + /// The unlocalized name (or ID) of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)Name).Value = value ?? null; } + + /// Backing field for property. + private string _unit; + + /// The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Unit { get => this._unit; set => this._unit = value; } + + /// Creates an new instance. + public Quota() + { + + } + } + /// Describes a quota for or usage details about a resource + public partial interface IQuota : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// The current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current value of the quota. If null or missing, the current value cannot be determined in the context of the request.", + SerializedName = @"currentValue", + PossibleTypes = new [] { typeof(double) })] + double? CurrentValue { get; set; } + /// The resource ID of the quota object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the quota object", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// + /// The maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage.", + SerializedName = @"limit", + PossibleTypes = new [] { typeof(double) })] + double? Limit { get; set; } + /// The localized name of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized name of the quota", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string NameLocalizedValue { get; set; } + /// The unlocalized name (or ID) of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unlocalized name (or ID) of the quota", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string NameValue { get; set; } + /// The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unit for the quota, such as Count, Bytes, BytesPerSecond, etc.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string Unit { get; set; } + + } + /// Describes a quota for or usage details about a resource + internal partial interface IQuotaInternal + + { + /// + /// The current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + /// + double? CurrentValue { get; set; } + /// The resource ID of the quota object + string Id { get; set; } + /// + /// The maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + /// + double? Limit { get; set; } + /// The name of the quota + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName Name { get; set; } + /// The localized name of the quota + string NameLocalizedValue { get; set; } + /// The unlocalized name (or ID) of the quota + string NameValue { get; set; } + /// The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + string Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.json.cs new file mode 100644 index 000000000000..6b8251b624a5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Quota.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes a quota for or usage details about a resource + public partial class Quota + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new Quota(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal Quota(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaName.FromJson(__jsonName) : Name;} + {_currentValue = If( json?.PropertyT("currentValue"), out var __jsonCurrentValue) ? (double?)__jsonCurrentValue : CurrentValue;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_limit = If( json?.PropertyT("limit"), out var __jsonLimit) ? (double?)__jsonLimit : Limit;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add ); + AddIf( null != this._currentValue ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._currentValue) : null, "currentValue" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != this._limit ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._limit) : null, "limit" ,container.Add ); + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.PowerShell.cs new file mode 100644 index 000000000000..16db63f3aed3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// OData page of quota objects + [System.ComponentModel.TypeConverter(typeof(QuotaListTypeConverter))] + public partial class QuotaList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QuotaList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QuotaList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QuotaList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QuotaList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.QuotaTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OData page of quota objects + [System.ComponentModel.TypeConverter(typeof(QuotaListTypeConverter))] + public partial interface IQuotaList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.TypeConverter.cs new file mode 100644 index 000000000000..a1f5cf596e22 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QuotaListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QuotaList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QuotaList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QuotaList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.cs new file mode 100644 index 000000000000..a91c588ff234 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of quota objects + public partial class QuotaList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// + /// URL to load the next page of quotas, or null or missing if this is the last page + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota[] _value; + + /// List of quotas + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public QuotaList() + { + + } + } + /// OData page of quota objects + public partial interface IQuotaList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// URL to load the next page of quotas, or null or missing if this is the last page + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to load the next page of quotas, or null or missing if this is the last page", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of quotas + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of quotas", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota[] Value { get; set; } + + } + /// OData page of quota objects + internal partial interface IQuotaListInternal + + { + /// + /// URL to load the next page of quotas, or null or missing if this is the last page + /// + string NextLink { get; set; } + /// List of quotas + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.json.cs new file mode 100644 index 000000000000..70b9e7329b0d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of quota objects + public partial class QuotaList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new QuotaList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal QuotaList(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Quota.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.PowerShell.cs new file mode 100644 index 000000000000..895a58615e62 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// The name of the quota + [System.ComponentModel.TypeConverter(typeof(QuotaNameTypeConverter))] + public partial class QuotaName + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QuotaName(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QuotaName(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QuotaName(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).LocalizedValue, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QuotaName(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).LocalizedValue, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The name of the quota + [System.ComponentModel.TypeConverter(typeof(QuotaNameTypeConverter))] + public partial interface IQuotaName + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.TypeConverter.cs new file mode 100644 index 000000000000..ea85bbe6a31d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QuotaNameTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QuotaName.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QuotaName.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QuotaName.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.cs new file mode 100644 index 000000000000..5ca79ce8ae35 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// The name of the quota + public partial class QuotaName : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaNameInternal + { + + /// Backing field for property. + private string _localizedValue; + + /// The localized name of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LocalizedValue { get => this._localizedValue; set => this._localizedValue = value; } + + /// Backing field for property. + private string _value; + + /// The unlocalized name (or ID) of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public QuotaName() + { + + } + } + /// The name of the quota + public partial interface IQuotaName : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The localized name of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized name of the quota", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string LocalizedValue { get; set; } + /// The unlocalized name (or ID) of the quota + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unlocalized name (or ID) of the quota", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// The name of the quota + internal partial interface IQuotaNameInternal + + { + /// The localized name of the quota + string LocalizedValue { get; set; } + /// The unlocalized name (or ID) of the quota + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.json.cs new file mode 100644 index 000000000000..3d7f588bc87b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/QuotaName.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// The name of the quota + public partial class QuotaName + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuotaName FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new QuotaName(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal QuotaName(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_localizedValue = If( json?.PropertyT("localizedValue"), out var __jsonLocalizedValue) ? (string)__jsonLocalizedValue : (string)LocalizedValue;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._localizedValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._localizedValue.ToString()) : null, "localizedValue" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.PowerShell.cs new file mode 100644 index 000000000000..14165a4b3e4d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// An authentication key to regenerate. + [System.ComponentModel.TypeConverter(typeof(RegenAuthKeysTypeConverter))] + public partial class RegenAuthKeys + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RegenAuthKeys(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RegenAuthKeys(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RegenAuthKeys(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("AuthKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey1 = (string) content.GetValueForProperty("AuthKey1",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey1, global::System.Convert.ToString); + } + if (content.Contains("AuthKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey2 = (string) content.GetValueForProperty("AuthKey2",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey2, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RegenAuthKeys(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("AuthKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey1 = (string) content.GetValueForProperty("AuthKey1",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey1, global::System.Convert.ToString); + } + if (content.Contains("AuthKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey2 = (string) content.GetValueForProperty("AuthKey2",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal)this).AuthKey2, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An authentication key to regenerate. + [System.ComponentModel.TypeConverter(typeof(RegenAuthKeysTypeConverter))] + public partial interface IRegenAuthKeys + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.TypeConverter.cs new file mode 100644 index 000000000000..a6b02c7b85bd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RegenAuthKeysTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RegenAuthKeys.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RegenAuthKeys.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RegenAuthKeys.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.cs new file mode 100644 index 000000000000..c56e657070a8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An authentication key to regenerate. + public partial class RegenAuthKeys : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeysInternal + { + + /// Backing field for property. + private string _authKey1; + + /// The first authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AuthKey1 { get => this._authKey1; set => this._authKey1 = value; } + + /// Backing field for property. + private string _authKey2; + + /// The second authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AuthKey2 { get => this._authKey2; set => this._authKey2 = value; } + + /// Backing field for property. + private string _keyName; + + /// The name of authentication key to generate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string KeyName { get => this._keyName; set => this._keyName = value; } + + /// Creates an new instance. + public RegenAuthKeys() + { + + } + } + /// An authentication key to regenerate. + public partial interface IRegenAuthKeys : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The first authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The first authentication key.", + SerializedName = @"authKey1", + PossibleTypes = new [] { typeof(string) })] + string AuthKey1 { get; set; } + /// The second authentication key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The second authentication key.", + SerializedName = @"authKey2", + PossibleTypes = new [] { typeof(string) })] + string AuthKey2 { get; set; } + /// The name of authentication key to generate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of authentication key to generate.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyName { get; set; } + + } + /// An authentication key to regenerate. + internal partial interface IRegenAuthKeysInternal + + { + /// The first authentication key. + string AuthKey1 { get; set; } + /// The second authentication key. + string AuthKey2 { get; set; } + /// The name of authentication key to generate. + string KeyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.json.cs new file mode 100644 index 000000000000..5bdc90b99cb4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/RegenAuthKeys.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An authentication key to regenerate. + public partial class RegenAuthKeys + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new RegenAuthKeys(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal RegenAuthKeys(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)KeyName;} + {_authKey1 = If( json?.PropertyT("authKey1"), out var __jsonAuthKey1) ? (string)__jsonAuthKey1 : (string)AuthKey1;} + {_authKey2 = If( json?.PropertyT("authKey2"), out var __jsonAuthKey2) ? (string)__jsonAuthKey2 : (string)AuthKey2;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName" ,container.Add ); + AddIf( null != (((object)this._authKey1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authKey1.ToString()) : null, "authKey1" ,container.Add ); + AddIf( null != (((object)this._authKey2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authKey2.ToString()) : null, "authKey2" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.PowerShell.cs new file mode 100644 index 000000000000..7c94c1ae9b87 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Exception object for all custom exceptions + [System.ComponentModel.TypeConverter(typeof(ReportableExceptionTypeConverter))] + public partial class ReportableException + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportableException(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportableException(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportableException(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReportableException(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ActionableMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).ActionableMessage = (string) content.GetValueForProperty("ActionableMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).ActionableMessage, global::System.Convert.ToString); + } + if (content.Contains("FilePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).FilePath = (string) content.GetValueForProperty("FilePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).FilePath, global::System.Convert.ToString); + } + if (content.Contains("LineNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).LineNumber = (string) content.GetValueForProperty("LineNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).LineNumber, global::System.Convert.ToString); + } + if (content.Contains("HResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).HResult = (int?) content.GetValueForProperty("HResult",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).HResult, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StackTrace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).StackTrace = (string) content.GetValueForProperty("StackTrace",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal)this).StackTrace, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Exception object for all custom exceptions + [System.ComponentModel.TypeConverter(typeof(ReportableExceptionTypeConverter))] + public partial interface IReportableException + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.TypeConverter.cs new file mode 100644 index 000000000000..37ec911ad577 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportableExceptionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportableException.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportableException.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportableException.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.cs new file mode 100644 index 000000000000..776e492372f1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Exception object for all custom exceptions + public partial class ReportableException : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableExceptionInternal + { + + /// Backing field for property. + private string _actionableMessage; + + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ActionableMessage { get => this._actionableMessage; set => this._actionableMessage = value; } + + /// Backing field for property. + private string _filePath; + + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FilePath { get => this._filePath; set => this._filePath = value; } + + /// Backing field for property. + private int? _hResult; + + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? HResult { get => this._hResult; set => this._hResult = value; } + + /// Backing field for property. + private string _lineNumber; + + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LineNumber { get => this._lineNumber; set => this._lineNumber = value; } + + /// Backing field for property. + private string _message; + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string _stackTrace; + + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StackTrace { get => this._stackTrace; set => this._stackTrace = value; } + + /// Creates an new instance. + public ReportableException() + { + + } + } + /// Exception object for all custom exceptions + public partial interface IReportableException : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Actionable steps for this exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actionable steps for this exception", + SerializedName = @"actionableMessage", + PossibleTypes = new [] { typeof(string) })] + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path to the file where exception occurred", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Coded numerical value that is assigned to a specific exception", + SerializedName = @"hResult", + PossibleTypes = new [] { typeof(int) })] + int? HResult { get; set; } + /// The line number where exception occurred + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The line number where exception occurred", + SerializedName = @"lineNumber", + PossibleTypes = new [] { typeof(string) })] + string LineNumber { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Stack trace + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stack trace", + SerializedName = @"stackTrace", + PossibleTypes = new [] { typeof(string) })] + string StackTrace { get; set; } + + } + /// Exception object for all custom exceptions + internal partial interface IReportableExceptionInternal + + { + /// Actionable steps for this exception + string ActionableMessage { get; set; } + /// The path to the file where exception occurred + string FilePath { get; set; } + /// Coded numerical value that is assigned to a specific exception + int? HResult { get; set; } + /// The line number where exception occurred + string LineNumber { get; set; } + /// Error message + string Message { get; set; } + /// Stack trace + string StackTrace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.json.cs new file mode 100644 index 000000000000..39f93fce22f3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ReportableException.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Exception object for all custom exceptions + public partial class ReportableException + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ReportableException(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ReportableException(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_actionableMessage = If( json?.PropertyT("actionableMessage"), out var __jsonActionableMessage) ? (string)__jsonActionableMessage : (string)ActionableMessage;} + {_filePath = If( json?.PropertyT("filePath"), out var __jsonFilePath) ? (string)__jsonFilePath : (string)FilePath;} + {_lineNumber = If( json?.PropertyT("lineNumber"), out var __jsonLineNumber) ? (string)__jsonLineNumber : (string)LineNumber;} + {_hResult = If( json?.PropertyT("hResult"), out var __jsonHResult) ? (int?)__jsonHResult : HResult;} + {_stackTrace = If( json?.PropertyT("stackTrace"), out var __jsonStackTrace) ? (string)__jsonStackTrace : (string)StackTrace;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != (((object)this._actionableMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._actionableMessage.ToString()) : null, "actionableMessage" ,container.Add ); + AddIf( null != (((object)this._filePath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._filePath.ToString()) : null, "filePath" ,container.Add ); + AddIf( null != (((object)this._lineNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lineNumber.ToString()) : null, "lineNumber" ,container.Add ); + AddIf( null != this._hResult ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._hResult) : null, "hResult" ,container.Add ); + AddIf( null != (((object)this._stackTrace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._stackTrace.ToString()) : null, "stackTrace" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.PowerShell.cs new file mode 100644 index 000000000000..d943c175fd3f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// ARM resource. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// ARM resource. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.TypeConverter.cs new file mode 100644 index 000000000000..4371e6a2b597 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.cs new file mode 100644 index 000000000000..d6968f2604b8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// ARM resource. + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// ARM resource. + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource ID.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// ARM resource. + internal partial interface IResourceInternal + + { + /// Resource ID. + string Id { get; set; } + /// Resource name. + string Name { get; set; } + /// Resource type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.json.cs new file mode 100644 index 000000000000..bebf8a005e2b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/Resource.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// ARM resource. + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.PowerShell.cs new file mode 100644 index 000000000000..6737608dd5d2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.PowerShell.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes an available DMS SKU. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuTypeConverter))] + public partial class ResourceSku + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceSku(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceSku(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceSku(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Tier, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ApiVersion = (string[]) content.GetValueForProperty("ApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ApiVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Cost = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts[]) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Cost, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCostsTypeConverter.ConvertFrom)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapabilitiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Restriction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions[]) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Restriction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuRestrictionsTypeConverter.ConvertFrom)); + } + if (content.Contains("CapacityMinimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMinimum = (long?) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMinimum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityMaximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMaximum = (long?) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMaximum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityDefault = (long?) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityDefault, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType?) content.GetValueForProperty("CapacityScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceSku(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Tier, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ApiVersion = (string[]) content.GetValueForProperty("ApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).ApiVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Cost = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts[]) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Cost, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCostsTypeConverter.ConvertFrom)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapabilitiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Restriction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions[]) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).Restriction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuRestrictionsTypeConverter.ConvertFrom)); + } + if (content.Contains("CapacityMinimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMinimum = (long?) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMinimum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityMaximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMaximum = (long?) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityMaximum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityDefault = (long?) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityDefault, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType?) content.GetValueForProperty("CapacityScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal)this).CapacityScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes an available DMS SKU. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuTypeConverter))] + public partial interface IResourceSku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.TypeConverter.cs new file mode 100644 index 000000000000..ca06d63adb2e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceSkuTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceSku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceSku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceSku.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.cs new file mode 100644 index 000000000000..1d24fabd9f3a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes an available DMS SKU. + public partial class ResourceSku : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal + { + + /// Backing field for property. + private string[] _apiVersion; + + /// The api versions that support this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] ApiVersion { get => this._apiVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities[] _capability; + + /// A name value pair to describe the capability. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities[] Capability { get => this._capability; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity _capacity; + + /// Not used. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapacity()); } + + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Default; } + + /// The maximum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Maximum; } + + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public long? CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Minimum; } + + /// The scale type applicable to the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).ScaleType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts[] _cost; + + /// Metadata for retrieving price info. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts[] Cost { get => this._cost; } + + /// Backing field for property. + private string _family; + + /// The Family of this particular SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Family { get => this._family; } + + /// Backing field for property. + private string _kind; + + /// The Kind of resources that are supported in this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Kind { get => this._kind; } + + /// Backing field for property. + private string[] _location; + + /// The set of locations that the SKU is available. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Location { get => this._location; } + + /// Internal Acessors for ApiVersion + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.ApiVersion { get => this._apiVersion; set { {_apiVersion = value;} } } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for Capacity + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapacity()); set { {_capacity = value;} } } + + /// Internal Acessors for CapacityDefault + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Default = value; } + + /// Internal Acessors for CapacityMaximum + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Maximum = value; } + + /// Internal Acessors for CapacityMinimum + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).Minimum = value; } + + /// Internal Acessors for CapacityScaleType + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).ScaleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)Capacity).ScaleType = value; } + + /// Internal Acessors for Cost + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Cost { get => this._cost; set { {_cost = value;} } } + + /// Internal Acessors for Family + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Family { get => this._family; set { {_family = value;} } } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for Location + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for Restriction + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Restriction { get => this._restriction; set { {_restriction = value;} } } + + /// Internal Acessors for Size + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Size { get => this._size; set { {_size = value;} } } + + /// Internal Acessors for Tier + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuInternal.Tier { get => this._tier; set { {_tier = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _resourceType; + + /// The type of resource the SKU applies to. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions[] _restriction; + + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions[] Restriction { get => this._restriction; } + + /// Backing field for property. + private string _size; + + /// The Size of the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Size { get => this._size; } + + /// Backing field for property. + private string _tier; + + /// Specifies the tier of DMS in a scale set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Tier { get => this._tier; } + + /// Creates an new instance. + public ResourceSku() + { + + } + } + /// Describes an available DMS SKU. + public partial interface IResourceSku : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The api versions that support this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The api versions that support this SKU.", + SerializedName = @"apiVersions", + PossibleTypes = new [] { typeof(string) })] + string[] ApiVersion { get; } + /// A name value pair to describe the capability. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A name value pair to describe the capability.", + SerializedName = @"capabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities[] Capability { get; } + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The default capacity.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(long) })] + long? CapacityDefault { get; } + /// The maximum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The maximum capacity.", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(long) })] + long? CapacityMaximum { get; } + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The minimum capacity.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(long) })] + long? CapacityMinimum { get; } + /// The scale type applicable to the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The scale type applicable to the SKU.", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? CapacityScaleType { get; } + /// Metadata for retrieving price info. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metadata for retrieving price info.", + SerializedName = @"costs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts[] Cost { get; } + /// The Family of this particular SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Family of this particular SKU.", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + string Family { get; } + /// The Kind of resources that are supported in this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Kind of resources that are supported in this SKU.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// The set of locations that the SKU is available. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The set of locations that the SKU is available.", + SerializedName = @"locations", + PossibleTypes = new [] { typeof(string) })] + string[] Location { get; } + /// The name of SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The type of resource the SKU applies to. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of resource the SKU applies to.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.", + SerializedName = @"restrictions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions[] Restriction { get; } + /// The Size of the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Size of the SKU.", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string Size { get; } + /// Specifies the tier of DMS in a scale set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies the tier of DMS in a scale set.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + string Tier { get; } + + } + /// Describes an available DMS SKU. + internal partial interface IResourceSkuInternal + + { + /// The api versions that support this SKU. + string[] ApiVersion { get; set; } + /// A name value pair to describe the capability. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities[] Capability { get; set; } + /// Not used. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity Capacity { get; set; } + /// The default capacity. + long? CapacityDefault { get; set; } + /// The maximum capacity. + long? CapacityMaximum { get; set; } + /// The minimum capacity. + long? CapacityMinimum { get; set; } + /// The scale type applicable to the SKU. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? CapacityScaleType { get; set; } + /// Metadata for retrieving price info. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts[] Cost { get; set; } + /// The Family of this particular SKU. + string Family { get; set; } + /// The Kind of resources that are supported in this SKU. + string Kind { get; set; } + /// The set of locations that the SKU is available. + string[] Location { get; set; } + /// The name of SKU. + string Name { get; set; } + /// The type of resource the SKU applies to. + string ResourceType { get; set; } + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions[] Restriction { get; set; } + /// The Size of the SKU. + string Size { get; set; } + /// Specifies the tier of DMS in a scale set. + string Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.json.cs new file mode 100644 index 000000000000..e90728349d8f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSku.json.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes an available DMS SKU. + public partial class ResourceSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ResourceSku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSku(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapacity.FromJson(__jsonCapacity) : Capacity;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)Size;} + {_family = If( json?.PropertyT("family"), out var __jsonFamily) ? (string)__jsonFamily : (string)Family;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_location = If( json?.PropertyT("locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Location;} + {_apiVersion = If( json?.PropertyT("apiVersions"), out var __jsonApiVersions) ? If( __jsonApiVersions as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ApiVersion;} + {_cost = If( json?.PropertyT("costs"), out var __jsonCosts) ? If( __jsonCosts as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCosts.FromJson(__k) )) ))() : null : Cost;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuCapabilities.FromJson(__f) )) ))() : null : Capability;} + {_restriction = If( json?.PropertyT("restrictions"), out var __jsonRestrictions) ? If( __jsonRestrictions as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuRestrictions.FromJson(__a) )) ))() : null : Restriction;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._capacity.ToJson(null,serializationMode) : null, "capacity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._size.ToString()) : null, "size" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._family)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._family.ToString()) : null, "family" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._location) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._location ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("locations",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._apiVersion) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._apiVersion ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("apiVersions",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._cost) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __n in this._cost ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("costs",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._capability) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __i in this._capability ) + { + AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); + } + container.Add("capabilities",__h); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._restriction) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __d in this._restriction ) + { + AddIf(__d?.ToJson(null, serializationMode) ,__c.Add); + } + container.Add("restrictions",__c); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.PowerShell.cs new file mode 100644 index 000000000000..9b319d944ba1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes The SKU capabilities object. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuCapabilitiesTypeConverter))] + public partial class ResourceSkuCapabilities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceSkuCapabilities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceSkuCapabilities(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceSkuCapabilities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceSkuCapabilities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes The SKU capabilities object. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuCapabilitiesTypeConverter))] + public partial interface IResourceSkuCapabilities + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.TypeConverter.cs new file mode 100644 index 000000000000..dda5bfc3461f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceSkuCapabilitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceSkuCapabilities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceSkuCapabilities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceSkuCapabilities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.cs new file mode 100644 index 000000000000..ec6f2fa83454 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes The SKU capabilities object. + public partial class ResourceSkuCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilitiesInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// An invariant to describe the feature. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _value; + + /// An invariant if the feature is measured by quantity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// Creates an new instance. + public ResourceSkuCapabilities() + { + + } + } + /// Describes The SKU capabilities object. + public partial interface IResourceSkuCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// An invariant to describe the feature. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant to describe the feature.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// An invariant if the feature is measured by quantity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant if the feature is measured by quantity.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// Describes The SKU capabilities object. + internal partial interface IResourceSkuCapabilitiesInternal + + { + /// An invariant to describe the feature. + string Name { get; set; } + /// An invariant if the feature is measured by quantity. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.json.cs new file mode 100644 index 000000000000..7a205ffa400f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapabilities.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes The SKU capabilities object. + public partial class ResourceSkuCapabilities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapabilities FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ResourceSkuCapabilities(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkuCapabilities(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.PowerShell.cs new file mode 100644 index 000000000000..cccd80901a57 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes scaling information of a SKU. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuCapacityTypeConverter))] + public partial class ResourceSkuCapacity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceSkuCapacity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceSkuCapacity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceSkuCapacity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Minimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Minimum = (long?) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Minimum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Maximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Maximum = (long?) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Maximum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Default")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Default = (long?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Default, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).ScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType?) content.GetValueForProperty("ScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).ScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceSkuCapacity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Minimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Minimum = (long?) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Minimum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Maximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Maximum = (long?) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Maximum, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Default")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Default = (long?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).Default, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ScaleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).ScaleType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType?) content.GetValueForProperty("ScaleType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal)this).ScaleType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes scaling information of a SKU. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuCapacityTypeConverter))] + public partial interface IResourceSkuCapacity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.TypeConverter.cs new file mode 100644 index 000000000000..7d90d2228757 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceSkuCapacityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceSkuCapacity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceSkuCapacity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceSkuCapacity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.cs new file mode 100644 index 000000000000..385b6dca19c5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ResourceSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal + { + + /// Backing field for property. + private long? _default; + + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Default { get => this._default; } + + /// Backing field for property. + private long? _maximum; + + /// The maximum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Maximum { get => this._maximum; } + + /// Internal Acessors for Default + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal.Default { get => this._default; set { {_default = value;} } } + + /// Internal Acessors for Maximum + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal.Maximum { get => this._maximum; set { {_maximum = value;} } } + + /// Internal Acessors for Minimum + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal.Minimum { get => this._minimum; set { {_minimum = value;} } } + + /// Internal Acessors for ScaleType + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacityInternal.ScaleType { get => this._scaleType; set { {_scaleType = value;} } } + + /// Backing field for property. + private long? _minimum; + + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Minimum { get => this._minimum; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? _scaleType; + + /// The scale type applicable to the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? ScaleType { get => this._scaleType; } + + /// Creates an new instance. + public ResourceSkuCapacity() + { + + } + } + /// Describes scaling information of a SKU. + public partial interface IResourceSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The default capacity.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(long) })] + long? Default { get; } + /// The maximum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The maximum capacity.", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(long) })] + long? Maximum { get; } + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The minimum capacity.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(long) })] + long? Minimum { get; } + /// The scale type applicable to the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The scale type applicable to the SKU.", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? ScaleType { get; } + + } + /// Describes scaling information of a SKU. + internal partial interface IResourceSkuCapacityInternal + + { + /// The default capacity. + long? Default { get; set; } + /// The maximum capacity. + long? Maximum { get; set; } + /// The minimum capacity. + long? Minimum { get; set; } + /// The scale type applicable to the SKU. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType? ScaleType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.json.cs new file mode 100644 index 000000000000..66229e845358 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCapacity.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ResourceSkuCapacity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ResourceSkuCapacity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkuCapacity(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (long?)__jsonMinimum : Minimum;} + {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (long?)__jsonMaximum : Maximum;} + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (long?)__jsonDefault : Default;} + {_scaleType = If( json?.PropertyT("scaleType"), out var __jsonScaleType) ? (string)__jsonScaleType : (string)ScaleType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._minimum ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._minimum) : null, "minimum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maximum ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._maximum) : null, "maximum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._default ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._default) : null, "default" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._scaleType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._scaleType.ToString()) : null, "scaleType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.PowerShell.cs new file mode 100644 index 000000000000..538b446af761 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes metadata for retrieving price info. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuCostsTypeConverter))] + public partial class ResourceSkuCosts + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceSkuCosts(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceSkuCosts(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceSkuCosts(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).Quantity = (long?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).Quantity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ExtendedUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).ExtendedUnit = (string) content.GetValueForProperty("ExtendedUnit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).ExtendedUnit, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceSkuCosts(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).Quantity = (long?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).Quantity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ExtendedUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).ExtendedUnit = (string) content.GetValueForProperty("ExtendedUnit",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal)this).ExtendedUnit, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes metadata for retrieving price info. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuCostsTypeConverter))] + public partial interface IResourceSkuCosts + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.TypeConverter.cs new file mode 100644 index 000000000000..e8cc479edd5c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceSkuCostsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceSkuCosts.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceSkuCosts.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceSkuCosts.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.cs new file mode 100644 index 000000000000..3b9dd4bb7765 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes metadata for retrieving price info. + public partial class ResourceSkuCosts : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal + { + + /// Backing field for property. + private string _extendedUnit; + + /// An invariant to show the extended unit. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ExtendedUnit { get => this._extendedUnit; } + + /// Backing field for property. + private string _meterId; + + /// Used for querying price from commerce. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for ExtendedUnit + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal.ExtendedUnit { get => this._extendedUnit; set { {_extendedUnit = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for Quantity + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCostsInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Backing field for property. + private long? _quantity; + + /// The multiplier is needed to extend the base metered cost. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? Quantity { get => this._quantity; } + + /// Creates an new instance. + public ResourceSkuCosts() + { + + } + } + /// Describes metadata for retrieving price info. + public partial interface IResourceSkuCosts : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// An invariant to show the extended unit. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant to show the extended unit.", + SerializedName = @"extendedUnit", + PossibleTypes = new [] { typeof(string) })] + string ExtendedUnit { get; } + /// Used for querying price from commerce. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Used for querying price from commerce.", + SerializedName = @"meterID", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// The multiplier is needed to extend the base metered cost. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The multiplier is needed to extend the base metered cost.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(long) })] + long? Quantity { get; } + + } + /// Describes metadata for retrieving price info. + internal partial interface IResourceSkuCostsInternal + + { + /// An invariant to show the extended unit. + string ExtendedUnit { get; set; } + /// Used for querying price from commerce. + string MeterId { get; set; } + /// The multiplier is needed to extend the base metered cost. + long? Quantity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.json.cs new file mode 100644 index 000000000000..c724a34a7616 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuCosts.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes metadata for retrieving price info. + public partial class ResourceSkuCosts + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuCosts FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ResourceSkuCosts(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkuCosts(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meterId = If( json?.PropertyT("meterID"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (long?)__jsonQuantity : Quantity;} + {_extendedUnit = If( json?.PropertyT("extendedUnit"), out var __jsonExtendedUnit) ? (string)__jsonExtendedUnit : (string)ExtendedUnit;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterID" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._extendedUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._extendedUnit.ToString()) : null, "extendedUnit" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.PowerShell.cs new file mode 100644 index 000000000000..513aabf9e10f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Describes scaling information of a SKU. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuRestrictionsTypeConverter))] + public partial class ResourceSkuRestrictions + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceSkuRestrictions(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceSkuRestrictions(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceSkuRestrictions(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ReasonCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).ReasonCode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode?) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).ReasonCode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceSkuRestrictions(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ReasonCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).ReasonCode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode?) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal)this).ReasonCode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes scaling information of a SKU. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuRestrictionsTypeConverter))] + public partial interface IResourceSkuRestrictions + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.TypeConverter.cs new file mode 100644 index 000000000000..0b7ad3afaa8c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceSkuRestrictionsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceSkuRestrictions.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceSkuRestrictions.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceSkuRestrictions.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.cs new file mode 100644 index 000000000000..0a8666ddd532 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ResourceSkuRestrictions : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal + { + + /// Internal Acessors for ReasonCode + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal.ReasonCode { get => this._reasonCode; set { {_reasonCode = value;} } } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Value + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictionsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode? _reasonCode; + + /// The reason code for restriction. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode? ReasonCode { get => this._reasonCode; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType? _type; + + /// The type of restrictions. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType? Type { get => this._type; } + + /// Backing field for property. + private string[] _value; + + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] Value { get => this._value; } + + /// Creates an new instance. + public ResourceSkuRestrictions() + { + + } + } + /// Describes scaling information of a SKU. + public partial interface IResourceSkuRestrictions : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The reason code for restriction. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reason code for restriction.", + SerializedName = @"reasonCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode? ReasonCode { get; } + /// The type of restrictions. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of restrictions.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType? Type { get; } + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; } + + } + /// Describes scaling information of a SKU. + internal partial interface IResourceSkuRestrictionsInternal + + { + /// The reason code for restriction. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode? ReasonCode { get; set; } + /// The type of restrictions. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType? Type { get; set; } + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.json.cs new file mode 100644 index 000000000000..88ad4f680615 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkuRestrictions.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ResourceSkuRestrictions + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkuRestrictions FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ResourceSkuRestrictions(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkuRestrictions(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_reasonCode = If( json?.PropertyT("reasonCode"), out var __jsonReasonCode) ? (string)__jsonReasonCode : (string)ReasonCode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reasonCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._reasonCode.ToString()) : null, "reasonCode" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.PowerShell.cs new file mode 100644 index 000000000000..1207682d213c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// The DMS List SKUs operation response. + [System.ComponentModel.TypeConverter(typeof(ResourceSkusResultTypeConverter))] + public partial class ResourceSkusResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceSkusResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceSkusResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceSkusResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceSkusResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSkuTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The DMS List SKUs operation response. + [System.ComponentModel.TypeConverter(typeof(ResourceSkusResultTypeConverter))] + public partial interface IResourceSkusResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.TypeConverter.cs new file mode 100644 index 000000000000..b5b60ae9606f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceSkusResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceSkusResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceSkusResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceSkusResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.cs new file mode 100644 index 000000000000..f29df4613c2e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// The DMS List SKUs operation response. + public partial class ResourceSkusResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// + /// The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the next page of DMS SKUs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku[] _value; + + /// The list of SKUs available for the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ResourceSkusResult() + { + + } + } + /// The DMS List SKUs operation response. + public partial interface IResourceSkusResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// + /// The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the next page of DMS SKUs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the next page of DMS SKUs.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of SKUs available for the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of SKUs available for the subscription.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku[] Value { get; set; } + + } + /// The DMS List SKUs operation response. + internal partial interface IResourceSkusResultInternal + + { + /// + /// The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the next page of DMS SKUs. + /// + string NextLink { get; set; } + /// The list of SKUs available for the subscription. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.json.cs new file mode 100644 index 000000000000..f4dba6d97d29 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ResourceSkusResult.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// The DMS List SKUs operation response. + public partial class ResourceSkusResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSkusResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ResourceSkusResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkusResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ResourceSku.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.PowerShell.cs new file mode 100644 index 000000000000..f4c85298cff5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Results for schema comparison between the source and target + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultTypeConverter))] + public partial class SchemaComparisonValidationResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SchemaComparisonValidationResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SchemaComparisonValidationResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SchemaComparisonValidationResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaDifference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifference = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType) content.GetValueForProperty("SchemaDifference",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifference, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SourceDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SourceDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) content.GetValueForProperty("SourceDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SourceDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).TargetDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) content.GetValueForProperty("TargetDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).TargetDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaDifferenceObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("SchemaDifferenceObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("ValidationErrorSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("ValidationErrorSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("SchemaDifferenceObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectName = (string) content.GetValueForProperty("SchemaDifferenceObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceUpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceUpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("SchemaDifferenceUpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceUpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + if (content.Contains("ValidationErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorText = (string) content.GetValueForProperty("ValidationErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorText, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SchemaComparisonValidationResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaDifference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifference = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType) content.GetValueForProperty("SchemaDifference",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifference, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTypeTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationError, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationErrorTypeConverter.ConvertFrom); + } + if (content.Contains("SourceDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SourceDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) content.GetValueForProperty("SourceDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SourceDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDatabaseObjectCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).TargetDatabaseObjectCount = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) content.GetValueForProperty("TargetDatabaseObjectCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).TargetDatabaseObjectCount, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter.ConvertFrom); + } + if (content.Contains("SchemaDifferenceObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("SchemaDifferenceObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("ValidationErrorSeverity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorSeverity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("ValidationErrorSeverity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorSeverity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + if (content.Contains("SchemaDifferenceObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectName = (string) content.GetValueForProperty("SchemaDifferenceObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceObjectName, global::System.Convert.ToString); + } + if (content.Contains("SchemaDifferenceUpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceUpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("SchemaDifferenceUpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).SchemaDifferenceUpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + if (content.Contains("ValidationErrorText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorText = (string) content.GetValueForProperty("ValidationErrorText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal)this).ValidationErrorText, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Results for schema comparison between the source and target + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultTypeConverter))] + public partial interface ISchemaComparisonValidationResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.TypeConverter.cs new file mode 100644 index 000000000000..040521a401dc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SchemaComparisonValidationResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SchemaComparisonValidationResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.cs new file mode 100644 index 000000000000..2a19fb0c429b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Results for schema comparison between the source and target + public partial class SchemaComparisonValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal + { + + /// Internal Acessors for SchemaDifference + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal.SchemaDifference { get => (this._schemaDifference = this._schemaDifference ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultType()); set { {_schemaDifference = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultInternal.ValidationError { get => (this._validationError = this._validationError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError()); set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType _schemaDifference; + + /// List of schema differences between the source and target databases + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType SchemaDifference { get => (this._schemaDifference = this._schemaDifference ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultType()); set => this._schemaDifference = value; } + + /// Name of the object that has the difference + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SchemaDifferenceObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)SchemaDifference).ObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)SchemaDifference).ObjectName = value ?? null; } + + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? SchemaDifferenceObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)SchemaDifference).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)SchemaDifference).ObjectType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType)""); } + + /// Update action type with respect to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? SchemaDifferenceUpdateAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)SchemaDifference).UpdateAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)SchemaDifference).UpdateAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount _sourceDatabaseObjectCount; + + /// Count of source database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount SourceDatabaseObjectCount { get => (this._sourceDatabaseObjectCount = this._sourceDatabaseObjectCount ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCount()); set => this._sourceDatabaseObjectCount = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount _targetDatabaseObjectCount; + + /// Count of target database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount TargetDatabaseObjectCount { get => (this._targetDatabaseObjectCount = this._targetDatabaseObjectCount ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCount()); set => this._targetDatabaseObjectCount = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError _validationError; + + /// List of errors that happened while performing schema compare validation + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError ValidationError { get => (this._validationError = this._validationError ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError()); set => this._validationError = value; } + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Severity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity)""); } + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ValidationErrorText { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)ValidationError).Text = value ?? null; } + + /// Creates an new instance. + public SchemaComparisonValidationResult() + { + + } + } + /// Results for schema comparison between the source and target + public partial interface ISchemaComparisonValidationResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the object that has the difference + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the object that has the difference", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string SchemaDifferenceObjectName { get; set; } + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the object that has the difference. e.g (Table/View/StoredProcedure)", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? SchemaDifferenceObjectType { get; set; } + /// Update action type with respect to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Update action type with respect to target", + SerializedName = @"updateAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? SchemaDifferenceUpdateAction { get; set; } + /// Count of source database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Count of source database objects", + SerializedName = @"sourceDatabaseObjectCount", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount SourceDatabaseObjectCount { get; set; } + /// Count of target database objects + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Count of target database objects", + SerializedName = @"targetDatabaseObjectCount", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount TargetDatabaseObjectCount { get; set; } + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the error", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get; set; } + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Text", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string ValidationErrorText { get; set; } + + } + /// Results for schema comparison between the source and target + internal partial interface ISchemaComparisonValidationResultInternal + + { + /// List of schema differences between the source and target databases + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType SchemaDifference { get; set; } + /// Name of the object that has the difference + string SchemaDifferenceObjectName { get; set; } + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? SchemaDifferenceObjectType { get; set; } + /// Update action type with respect to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? SchemaDifferenceUpdateAction { get; set; } + /// Count of source database objects + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount SourceDatabaseObjectCount { get; set; } + /// Count of target database objects + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount TargetDatabaseObjectCount { get; set; } + /// List of errors that happened while performing schema compare validation + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError ValidationError { get; set; } + /// Severity of the error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? ValidationErrorSeverity { get; set; } + /// Error Text + string ValidationErrorText { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.json.cs new file mode 100644 index 000000000000..a8c5fff44c8f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResult.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Results for schema comparison between the source and target + public partial class SchemaComparisonValidationResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SchemaComparisonValidationResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SchemaComparisonValidationResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_schemaDifference = If( json?.PropertyT("schemaDifferences"), out var __jsonSchemaDifferences) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultType.FromJson(__jsonSchemaDifferences) : SchemaDifference;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidationError.FromJson(__jsonValidationErrors) : ValidationError;} + {_sourceDatabaseObjectCount = If( json?.PropertyT("sourceDatabaseObjectCount"), out var __jsonSourceDatabaseObjectCount) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCount.FromJson(__jsonSourceDatabaseObjectCount) : SourceDatabaseObjectCount;} + {_targetDatabaseObjectCount = If( json?.PropertyT("targetDatabaseObjectCount"), out var __jsonTargetDatabaseObjectCount) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCount.FromJson(__jsonTargetDatabaseObjectCount) : TargetDatabaseObjectCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._schemaDifference ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._schemaDifference.ToJson(null,serializationMode) : null, "schemaDifferences" ,container.Add ); + AddIf( null != this._validationError ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._validationError.ToJson(null,serializationMode) : null, "validationErrors" ,container.Add ); + AddIf( null != this._sourceDatabaseObjectCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceDatabaseObjectCount.ToJson(null,serializationMode) : null, "sourceDatabaseObjectCount" ,container.Add ); + AddIf( null != this._targetDatabaseObjectCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetDatabaseObjectCount.ToJson(null,serializationMode) : null, "targetDatabaseObjectCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.PowerShell.cs new file mode 100644 index 000000000000..367397862095 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Count of source database objects + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter))] + public partial class SchemaComparisonValidationResultSourceDatabaseObjectCount + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SchemaComparisonValidationResultSourceDatabaseObjectCount(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SchemaComparisonValidationResultSourceDatabaseObjectCount(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SchemaComparisonValidationResultSourceDatabaseObjectCount(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SchemaComparisonValidationResultSourceDatabaseObjectCount(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Count of source database objects + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter))] + public partial interface ISchemaComparisonValidationResultSourceDatabaseObjectCount + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.TypeConverter.cs new file mode 100644 index 000000000000..ec2bec6ffd5e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SchemaComparisonValidationResultSourceDatabaseObjectCountTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SchemaComparisonValidationResultSourceDatabaseObjectCount.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResultSourceDatabaseObjectCount.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResultSourceDatabaseObjectCount.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.cs new file mode 100644 index 000000000000..20e081f64c57 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Count of source database objects + public partial class SchemaComparisonValidationResultSourceDatabaseObjectCount : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCountInternal + { + + /// + /// Creates an new instance. + /// + public SchemaComparisonValidationResultSourceDatabaseObjectCount() + { + + } + } + /// Count of source database objects + public partial interface ISchemaComparisonValidationResultSourceDatabaseObjectCount : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Count of source database objects + internal partial interface ISchemaComparisonValidationResultSourceDatabaseObjectCountInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.dictionary.cs new file mode 100644 index 000000000000..0a57be1fe84d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class SchemaComparisonValidationResultSourceDatabaseObjectCount : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public long this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, long value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out long value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultSourceDatabaseObjectCount source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.json.cs new file mode 100644 index 000000000000..a805b8c146ee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultSourceDatabaseObjectCount.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Count of source database objects + public partial class SchemaComparisonValidationResultSourceDatabaseObjectCount + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultSourceDatabaseObjectCount FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SchemaComparisonValidationResultSourceDatabaseObjectCount(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal SchemaComparisonValidationResultSourceDatabaseObjectCount(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.PowerShell.cs new file mode 100644 index 000000000000..894d0c8ce792 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.PowerShell.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Count of target database objects + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter))] + public partial class SchemaComparisonValidationResultTargetDatabaseObjectCount + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SchemaComparisonValidationResultTargetDatabaseObjectCount(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SchemaComparisonValidationResultTargetDatabaseObjectCount(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SchemaComparisonValidationResultTargetDatabaseObjectCount(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SchemaComparisonValidationResultTargetDatabaseObjectCount(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Count of target database objects + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter))] + public partial interface ISchemaComparisonValidationResultTargetDatabaseObjectCount + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.TypeConverter.cs new file mode 100644 index 000000000000..7571c0319798 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SchemaComparisonValidationResultTargetDatabaseObjectCountTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SchemaComparisonValidationResultTargetDatabaseObjectCount.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResultTargetDatabaseObjectCount.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResultTargetDatabaseObjectCount.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.cs new file mode 100644 index 000000000000..f27f547fc95d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Count of target database objects + public partial class SchemaComparisonValidationResultTargetDatabaseObjectCount : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCountInternal + { + + /// + /// Creates an new instance. + /// + public SchemaComparisonValidationResultTargetDatabaseObjectCount() + { + + } + } + /// Count of target database objects + public partial interface ISchemaComparisonValidationResultTargetDatabaseObjectCount : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Count of target database objects + internal partial interface ISchemaComparisonValidationResultTargetDatabaseObjectCountInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.dictionary.cs new file mode 100644 index 000000000000..526f5a60098d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class SchemaComparisonValidationResultTargetDatabaseObjectCount : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public long this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, long value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out long value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SchemaComparisonValidationResultTargetDatabaseObjectCount source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.json.cs new file mode 100644 index 000000000000..800e97b3021e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultTargetDatabaseObjectCount.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Count of target database objects + public partial class SchemaComparisonValidationResultTargetDatabaseObjectCount + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTargetDatabaseObjectCount FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SchemaComparisonValidationResultTargetDatabaseObjectCount(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal SchemaComparisonValidationResultTargetDatabaseObjectCount(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.PowerShell.cs new file mode 100644 index 000000000000..d0442fa4674f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Description about the errors happen while performing migration validation + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultTypeTypeConverter))] + public partial class SchemaComparisonValidationResultType + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SchemaComparisonValidationResultType(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SchemaComparisonValidationResultType(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SchemaComparisonValidationResultType(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("UpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).UpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("UpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).UpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SchemaComparisonValidationResultType(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectName = (string) content.GetValueForProperty("ObjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectName, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType?) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType.CreateFrom); + } + if (content.Contains("UpdateAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).UpdateAction = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType?) content.GetValueForProperty("UpdateAction",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal)this).UpdateAction, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Description about the errors happen while performing migration validation + [System.ComponentModel.TypeConverter(typeof(SchemaComparisonValidationResultTypeTypeConverter))] + public partial interface ISchemaComparisonValidationResultType + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.TypeConverter.cs new file mode 100644 index 000000000000..cb8b61d18303 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SchemaComparisonValidationResultTypeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SchemaComparisonValidationResultType.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResultType.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SchemaComparisonValidationResultType.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.cs new file mode 100644 index 000000000000..123fd9b545c8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description about the errors happen while performing migration validation + public partial class SchemaComparisonValidationResultType : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultTypeInternal + { + + /// Backing field for property. + private string _objectName; + + /// Name of the object that has the difference + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ObjectName { get => this._objectName; set => this._objectName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? _objectType; + + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? _updateAction; + + /// Update action type with respect to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? UpdateAction { get => this._updateAction; set => this._updateAction = value; } + + /// Creates an new instance. + public SchemaComparisonValidationResultType() + { + + } + } + /// Description about the errors happen while performing migration validation + public partial interface ISchemaComparisonValidationResultType : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the object that has the difference + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the object that has the difference", + SerializedName = @"objectName", + PossibleTypes = new [] { typeof(string) })] + string ObjectName { get; set; } + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the object that has the difference. e.g (Table/View/StoredProcedure)", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? ObjectType { get; set; } + /// Update action type with respect to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Update action type with respect to target", + SerializedName = @"updateAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? UpdateAction { get; set; } + + } + /// Description about the errors happen while performing migration validation + internal partial interface ISchemaComparisonValidationResultTypeInternal + + { + /// Name of the object that has the difference + string ObjectName { get; set; } + /// Type of the object that has the difference. e.g (Table/View/StoredProcedure) + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType? ObjectType { get; set; } + /// Update action type with respect to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType? UpdateAction { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.json.cs new file mode 100644 index 000000000000..933996ab6602 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaComparisonValidationResultType.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description about the errors happen while performing migration validation + public partial class SchemaComparisonValidationResultType + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaComparisonValidationResultType FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SchemaComparisonValidationResultType(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SchemaComparisonValidationResultType(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectName = If( json?.PropertyT("objectName"), out var __jsonObjectName) ? (string)__jsonObjectName : (string)ObjectName;} + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + {_updateAction = If( json?.PropertyT("updateAction"), out var __jsonUpdateAction) ? (string)__jsonUpdateAction : (string)UpdateAction;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectName.ToString()) : null, "objectName" ,container.Add ); + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AddIf( null != (((object)this._updateAction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._updateAction.ToString()) : null, "updateAction" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.PowerShell.cs new file mode 100644 index 000000000000..35a173d9f1d0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Settings for migrating schema from source to target + [System.ComponentModel.TypeConverter(typeof(SchemaMigrationSettingTypeConverter))] + public partial class SchemaMigrationSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SchemaMigrationSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SchemaMigrationSetting(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SchemaMigrationSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).SchemaOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption?) content.GetValueForProperty("SchemaOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).SchemaOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption.CreateFrom); + } + if (content.Contains("FileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileId = (string) content.GetValueForProperty("FileId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileId, global::System.Convert.ToString); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SchemaMigrationSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SchemaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).SchemaOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption?) content.GetValueForProperty("SchemaOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).SchemaOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption.CreateFrom); + } + if (content.Contains("FileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileId = (string) content.GetValueForProperty("FileId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileId, global::System.Convert.ToString); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal)this).FileName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Settings for migrating schema from source to target + [System.ComponentModel.TypeConverter(typeof(SchemaMigrationSettingTypeConverter))] + public partial interface ISchemaMigrationSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.TypeConverter.cs new file mode 100644 index 000000000000..15bb54615f95 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SchemaMigrationSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SchemaMigrationSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SchemaMigrationSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SchemaMigrationSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.cs new file mode 100644 index 000000000000..6c7c12b95aec --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Settings for migrating schema from source to target + public partial class SchemaMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSettingInternal + { + + /// Backing field for property. + private string _fileId; + + /// Resource Identifier of a file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FileId { get => this._fileId; set => this._fileId = value; } + + /// Backing field for property. + private string _fileName; + + /// Name of the file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FileName { get => this._fileName; set => this._fileName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption? _schemaOption; + + /// Option on how to migrate the schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption? SchemaOption { get => this._schemaOption; set => this._schemaOption = value; } + + /// Creates an new instance. + public SchemaMigrationSetting() + { + + } + } + /// Settings for migrating schema from source to target + public partial interface ISchemaMigrationSetting : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Resource Identifier of a file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Identifier of a file resource containing the uploaded schema file", + SerializedName = @"fileId", + PossibleTypes = new [] { typeof(string) })] + string FileId { get; set; } + /// Name of the file resource containing the uploaded schema file + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the file resource containing the uploaded schema file", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + string FileName { get; set; } + /// Option on how to migrate the schema + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Option on how to migrate the schema", + SerializedName = @"schemaOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption? SchemaOption { get; set; } + + } + /// Settings for migrating schema from source to target + internal partial interface ISchemaMigrationSettingInternal + + { + /// Resource Identifier of a file resource containing the uploaded schema file + string FileId { get; set; } + /// Name of the file resource containing the uploaded schema file + string FileName { get; set; } + /// Option on how to migrate the schema + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption? SchemaOption { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.json.cs new file mode 100644 index 000000000000..49bce748adbb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SchemaMigrationSetting.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Settings for migrating schema from source to target + public partial class SchemaMigrationSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISchemaMigrationSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SchemaMigrationSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SchemaMigrationSetting(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_schemaOption = If( json?.PropertyT("schemaOption"), out var __jsonSchemaOption) ? (string)__jsonSchemaOption : (string)SchemaOption;} + {_fileId = If( json?.PropertyT("fileId"), out var __jsonFileId) ? (string)__jsonFileId : (string)FileId;} + {_fileName = If( json?.PropertyT("fileName"), out var __jsonFileName) ? (string)__jsonFileName : (string)FileName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._schemaOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._schemaOption.ToString()) : null, "schemaOption" ,container.Add ); + AddIf( null != (((object)this._fileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileId.ToString()) : null, "fileId" ,container.Add ); + AddIf( null != (((object)this._fileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileName.ToString()) : null, "fileName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.PowerShell.cs new file mode 100644 index 000000000000..4b8958cb0c51 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Info for certificate to be exported for TDE enabled databases. + [System.ComponentModel.TypeConverter(typeof(SelectedCertificateInputTypeConverter))] + public partial class SelectedCertificateInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SelectedCertificateInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SelectedCertificateInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SelectedCertificateInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CertificateName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).CertificateName = (string) content.GetValueForProperty("CertificateName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).CertificateName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SelectedCertificateInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CertificateName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).CertificateName = (string) content.GetValueForProperty("CertificateName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).CertificateName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Info for certificate to be exported for TDE enabled databases. + [System.ComponentModel.TypeConverter(typeof(SelectedCertificateInputTypeConverter))] + public partial interface ISelectedCertificateInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.TypeConverter.cs new file mode 100644 index 000000000000..98b109fa27a9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SelectedCertificateInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SelectedCertificateInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SelectedCertificateInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SelectedCertificateInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.cs new file mode 100644 index 000000000000..b1c08fbaa954 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Info for certificate to be exported for TDE enabled databases. + public partial class SelectedCertificateInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInputInternal + { + + /// Backing field for property. + private string _certificateName; + + /// Name of certificate to be exported. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CertificateName { get => this._certificateName; set => this._certificateName = value; } + + /// Backing field for property. + private string _password; + + /// Password to use for encrypting the exported certificate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Password { get => this._password; set => this._password = value; } + + /// Creates an new instance. + public SelectedCertificateInput() + { + + } + } + /// Info for certificate to be exported for TDE enabled databases. + public partial interface ISelectedCertificateInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of certificate to be exported. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of certificate to be exported.", + SerializedName = @"certificateName", + PossibleTypes = new [] { typeof(string) })] + string CertificateName { get; set; } + /// Password to use for encrypting the exported certificate. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Password to use for encrypting the exported certificate.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + + } + /// Info for certificate to be exported for TDE enabled databases. + internal partial interface ISelectedCertificateInputInternal + + { + /// Name of certificate to be exported. + string CertificateName { get; set; } + /// Password to use for encrypting the exported certificate. + string Password { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.json.cs new file mode 100644 index 000000000000..678c94db6430 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SelectedCertificateInput.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Info for certificate to be exported for TDE enabled databases. + public partial class SelectedCertificateInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISelectedCertificateInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SelectedCertificateInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SelectedCertificateInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_certificateName = If( json?.PropertyT("certificateName"), out var __jsonCertificateName) ? (string)__jsonCertificateName : (string)CertificateName;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._certificateName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._certificateName.ToString()) : null, "certificateName" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.PowerShell.cs new file mode 100644 index 000000000000..326512485b6b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Server properties for MySQL type source + [System.ComponentModel.TypeConverter(typeof(ServerPropertiesTypeConverter))] + public partial class ServerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServerProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerPlatform = (string) content.GetValueForProperty("ServerPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerPlatform, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerEdition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerEdition = (string) content.GetValueForProperty("ServerEdition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerEdition, global::System.Convert.ToString); + } + if (content.Contains("ServerOperatingSystemVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerOperatingSystemVersion = (string) content.GetValueForProperty("ServerOperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerOperatingSystemVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerDatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerDatabaseCount = (int?) content.GetValueForProperty("ServerDatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerDatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServerPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerPlatform = (string) content.GetValueForProperty("ServerPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerPlatform, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerEdition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerEdition = (string) content.GetValueForProperty("ServerEdition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerEdition, global::System.Convert.ToString); + } + if (content.Contains("ServerOperatingSystemVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerOperatingSystemVersion = (string) content.GetValueForProperty("ServerOperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerOperatingSystemVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerDatabaseCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerDatabaseCount = (int?) content.GetValueForProperty("ServerDatabaseCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal)this).ServerDatabaseCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Server properties for MySQL type source + [System.ComponentModel.TypeConverter(typeof(ServerPropertiesTypeConverter))] + public partial interface IServerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.TypeConverter.cs new file mode 100644 index 000000000000..3dd9f1aaa073 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServerPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServerProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.cs new file mode 100644 index 000000000000..771f687d1f32 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Server properties for MySQL type source + public partial class ServerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal + { + + /// Internal Acessors for ServerDatabaseCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal.ServerDatabaseCount { get => this._serverDatabaseCount; set { {_serverDatabaseCount = value;} } } + + /// Internal Acessors for ServerEdition + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal.ServerEdition { get => this._serverEdition; set { {_serverEdition = value;} } } + + /// Internal Acessors for ServerName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal.ServerName { get => this._serverName; set { {_serverName = value;} } } + + /// Internal Acessors for ServerOperatingSystemVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal.ServerOperatingSystemVersion { get => this._serverOperatingSystemVersion; set { {_serverOperatingSystemVersion = value;} } } + + /// Internal Acessors for ServerPlatform + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal.ServerPlatform { get => this._serverPlatform; set { {_serverPlatform = value;} } } + + /// Internal Acessors for ServerVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerPropertiesInternal.ServerVersion { get => this._serverVersion; set { {_serverVersion = value;} } } + + /// Backing field for property. + private int? _serverDatabaseCount; + + /// Number of databases in the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? ServerDatabaseCount { get => this._serverDatabaseCount; } + + /// Backing field for property. + private string _serverEdition; + + /// Edition of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerEdition { get => this._serverEdition; } + + /// Backing field for property. + private string _serverName; + + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; } + + /// Backing field for property. + private string _serverOperatingSystemVersion; + + /// Version of the operating system + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerOperatingSystemVersion { get => this._serverOperatingSystemVersion; } + + /// Backing field for property. + private string _serverPlatform; + + /// Name of the server platform + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerPlatform { get => this._serverPlatform; } + + /// Backing field for property. + private string _serverVersion; + + /// Version of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; } + + /// Creates an new instance. + public ServerProperties() + { + + } + } + /// Server properties for MySQL type source + public partial interface IServerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Number of databases in the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of databases in the server", + SerializedName = @"serverDatabaseCount", + PossibleTypes = new [] { typeof(int) })] + int? ServerDatabaseCount { get; } + /// Edition of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Edition of the database server", + SerializedName = @"serverEdition", + PossibleTypes = new [] { typeof(string) })] + string ServerEdition { get; } + /// Name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; } + /// Version of the operating system + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the operating system", + SerializedName = @"serverOperatingSystemVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerOperatingSystemVersion { get; } + /// Name of the server platform + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the server platform", + SerializedName = @"serverPlatform", + PossibleTypes = new [] { typeof(string) })] + string ServerPlatform { get; } + /// Version of the database server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of the database server", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; } + + } + /// Server properties for MySQL type source + internal partial interface IServerPropertiesInternal + + { + /// Number of databases in the server + int? ServerDatabaseCount { get; set; } + /// Edition of the database server + string ServerEdition { get; set; } + /// Name of the server + string ServerName { get; set; } + /// Version of the operating system + string ServerOperatingSystemVersion { get; set; } + /// Name of the server platform + string ServerPlatform { get; set; } + /// Version of the database server + string ServerVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.json.cs new file mode 100644 index 000000000000..fe87608cc0a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServerProperties.json.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Server properties for MySQL type source + public partial class ServerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ServerProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ServerProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serverPlatform = If( json?.PropertyT("serverPlatform"), out var __jsonServerPlatform) ? (string)__jsonServerPlatform : (string)ServerPlatform;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + {_serverEdition = If( json?.PropertyT("serverEdition"), out var __jsonServerEdition) ? (string)__jsonServerEdition : (string)ServerEdition;} + {_serverOperatingSystemVersion = If( json?.PropertyT("serverOperatingSystemVersion"), out var __jsonServerOperatingSystemVersion) ? (string)__jsonServerOperatingSystemVersion : (string)ServerOperatingSystemVersion;} + {_serverDatabaseCount = If( json?.PropertyT("serverDatabaseCount"), out var __jsonServerDatabaseCount) ? (int?)__jsonServerDatabaseCount : ServerDatabaseCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serverPlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverPlatform.ToString()) : null, "serverPlatform" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serverEdition)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverEdition.ToString()) : null, "serverEdition" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serverOperatingSystemVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverOperatingSystemVersion.ToString()) : null, "serverOperatingSystemVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._serverDatabaseCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._serverDatabaseCount) : null, "serverDatabaseCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.PowerShell.cs new file mode 100644 index 000000000000..a801c5c67b87 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Description of an action supported by the Database Migration Service + [System.ComponentModel.TypeConverter(typeof(ServiceOperationTypeConverter))] + public partial class ServiceOperation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceOperation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceOperation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceOperation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceOperation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Description of an action supported by the Database Migration Service + [System.ComponentModel.TypeConverter(typeof(ServiceOperationTypeConverter))] + public partial interface IServiceOperation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.TypeConverter.cs new file mode 100644 index 000000000000..32b157fb6029 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceOperationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceOperation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceOperation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceOperation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.cs new file mode 100644 index 000000000000..39e74a92fb15 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description of an action supported by the Database Migration Service + public partial class ServiceOperation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay _display; + + /// Localized display text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationDisplay()); set => this._display = value; } + + /// The localized operation description + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Description = value ?? null; } + + /// The localized operation name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Operation = value ?? null; } + + /// The localized resource provider name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Provider = value ?? null; } + + /// The localized resource type name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationDisplay()); set { {_display = value;} } } + + /// Backing field for property. + private string _name; + + /// The fully qualified action name, e.g. Microsoft.DataMigration/services/read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ServiceOperation() + { + + } + } + /// Description of an action supported by the Database Migration Service + public partial interface IServiceOperation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The localized operation description + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized operation description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// The localized operation name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized operation name", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// The localized resource provider name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized resource provider name", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// The localized resource type name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized resource type name", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// The fully qualified action name, e.g. Microsoft.DataMigration/services/read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fully qualified action name, e.g. Microsoft.DataMigration/services/read", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Description of an action supported by the Database Migration Service + internal partial interface IServiceOperationInternal + + { + /// Localized display text + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay Display { get; set; } + /// The localized operation description + string DisplayDescription { get; set; } + /// The localized operation name + string DisplayOperation { get; set; } + /// The localized resource provider name + string DisplayProvider { get; set; } + /// The localized resource type name + string DisplayResource { get; set; } + /// The fully qualified action name, e.g. Microsoft.DataMigration/services/read + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.json.cs new file mode 100644 index 000000000000..6403cf863ed4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperation.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description of an action supported by the Database Migration Service + public partial class ServiceOperation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ServiceOperation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceOperation(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationDisplay.FromJson(__jsonDisplay) : Display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..a7799bab36cd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Localized display text + [System.ComponentModel.TypeConverter(typeof(ServiceOperationDisplayTypeConverter))] + public partial class ServiceOperationDisplay + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceOperationDisplay(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceOperationDisplay(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceOperationDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceOperationDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Localized display text + [System.ComponentModel.TypeConverter(typeof(ServiceOperationDisplayTypeConverter))] + public partial interface IServiceOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..6beeb587e66b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceOperationDisplayTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceOperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceOperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceOperationDisplay.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.cs new file mode 100644 index 000000000000..84c29bd8d2a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Localized display text + public partial class ServiceOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// The localized operation description + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _operation; + + /// The localized operation name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// The localized resource provider name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// The localized resource type name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public ServiceOperationDisplay() + { + + } + } + /// Localized display text + public partial interface IServiceOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The localized operation description + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized operation description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The localized operation name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized operation name", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// The localized resource provider name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized resource provider name", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// The localized resource type name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The localized resource type name", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// Localized display text + internal partial interface IServiceOperationDisplayInternal + + { + /// The localized operation description + string Description { get; set; } + /// The localized operation name + string Operation { get; set; } + /// The localized resource provider name + string Provider { get; set; } + /// The localized resource type name + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.json.cs new file mode 100644 index 000000000000..2bf1dd0ec44c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationDisplay.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Localized display text + public partial class ServiceOperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ServiceOperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceOperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.PowerShell.cs new file mode 100644 index 000000000000..c6f493b553ed --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// OData page of action (operation) objects + [System.ComponentModel.TypeConverter(typeof(ServiceOperationListTypeConverter))] + public partial class ServiceOperationList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceOperationList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceOperationList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceOperationList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceOperationList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OData page of action (operation) objects + [System.ComponentModel.TypeConverter(typeof(ServiceOperationListTypeConverter))] + public partial interface IServiceOperationList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.TypeConverter.cs new file mode 100644 index 000000000000..43db32c9660e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceOperationListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceOperationList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceOperationList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceOperationList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.cs new file mode 100644 index 000000000000..32cd0806ac1c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of action (operation) objects + public partial class ServiceOperationList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to load the next page of actions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation[] _value; + + /// List of actions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ServiceOperationList() + { + + } + } + /// OData page of action (operation) objects + public partial interface IServiceOperationList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// URL to load the next page of actions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to load the next page of actions", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of actions + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of actions", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation[] Value { get; set; } + + } + /// OData page of action (operation) objects + internal partial interface IServiceOperationListInternal + + { + /// URL to load the next page of actions + string NextLink { get; set; } + /// List of actions + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.json.cs new file mode 100644 index 000000000000..91d40890161a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceOperationList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of action (operation) objects + public partial class ServiceOperationList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ServiceOperationList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceOperationList(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceOperation) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ServiceOperation.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.PowerShell.cs new file mode 100644 index 000000000000..e2028fa48450 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.PowerShell.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// An Azure SKU instance + [System.ComponentModel.TypeConverter(typeof(ServiceSkuTypeConverter))] + public partial class ServiceSku + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceSku(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceSku(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceSku(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Tier, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Capacity = (int?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Capacity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceSku(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Tier, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Capacity = (int?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal)this).Capacity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An Azure SKU instance + [System.ComponentModel.TypeConverter(typeof(ServiceSkuTypeConverter))] + public partial interface IServiceSku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.TypeConverter.cs new file mode 100644 index 000000000000..8af2f0dc330c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceSkuTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceSku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceSku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceSku.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.cs new file mode 100644 index 000000000000..afe6668a9cf8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An Azure SKU instance + public partial class ServiceSku : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuInternal + { + + /// Backing field for property. + private int? _capacity; + + /// The capacity of the SKU, if it supports scaling + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Capacity { get => this._capacity; set => this._capacity = value; } + + /// Backing field for property. + private string _family; + + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Family { get => this._family; set => this._family = value; } + + /// Backing field for property. + private string _name; + + /// The unique name of the SKU, such as 'P3' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _size; + + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Size { get => this._size; set => this._size = value; } + + /// Backing field for property. + private string _tier; + + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Tier { get => this._tier; set => this._tier = value; } + + /// Creates an new instance. + public ServiceSku() + { + + } + } + /// An Azure SKU instance + public partial interface IServiceSku : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The capacity of the SKU, if it supports scaling + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity of the SKU, if it supports scaling", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + int? Capacity { get; set; } + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + string Family { get; set; } + /// The unique name of the SKU, such as 'P3' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique name of the SKU, such as 'P3'", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string Size { get; set; } + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + string Tier { get; set; } + + } + /// An Azure SKU instance + internal partial interface IServiceSkuInternal + + { + /// The capacity of the SKU, if it supports scaling + int? Capacity { get; set; } + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + string Family { get; set; } + /// The unique name of the SKU, such as 'P3' + string Name { get; set; } + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + string Size { get; set; } + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + string Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.json.cs new file mode 100644 index 000000000000..98e3b3ad2f95 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSku.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An Azure SKU instance + public partial class ServiceSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ServiceSku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceSku(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + {_family = If( json?.PropertyT("family"), out var __jsonFamily) ? (string)__jsonFamily : (string)Family;} + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)Size;} + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? (int?)__jsonCapacity : Capacity;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + AddIf( null != (((object)this._family)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._family.ToString()) : null, "family" ,container.Add ); + AddIf( null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._size.ToString()) : null, "size" ,container.Add ); + AddIf( null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._capacity) : null, "capacity" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.PowerShell.cs new file mode 100644 index 000000000000..b56f1e345194 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// OData page of available SKUs + [System.ComponentModel.TypeConverter(typeof(ServiceSkuListTypeConverter))] + public partial class ServiceSkuList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceSkuList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceSkuList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceSkuList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceSkuList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSkuTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OData page of available SKUs + [System.ComponentModel.TypeConverter(typeof(ServiceSkuListTypeConverter))] + public partial interface IServiceSkuList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.TypeConverter.cs new file mode 100644 index 000000000000..b0767a6a69c3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceSkuListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceSkuList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceSkuList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceSkuList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.cs new file mode 100644 index 000000000000..b7d3372a9820 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of available SKUs + public partial class ServiceSkuList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to load the next page of service SKUs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku[] _value; + + /// List of service SKUs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ServiceSkuList() + { + + } + } + /// OData page of available SKUs + public partial interface IServiceSkuList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// URL to load the next page of service SKUs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to load the next page of service SKUs", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of service SKUs + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of service SKUs", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku[] Value { get; set; } + + } + /// OData page of available SKUs + internal partial interface IServiceSkuListInternal + + { + /// URL to load the next page of service SKUs + string NextLink { get; set; } + /// List of service SKUs + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.json.cs new file mode 100644 index 000000000000..27ea6bc2f304 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ServiceSkuList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of available SKUs + public partial class ServiceSkuList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IServiceSkuList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ServiceSkuList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceSkuList(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AvailableServiceSku.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.PowerShell.cs new file mode 100644 index 000000000000..23cb2fc73d0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Source Location details of backups. + [System.ComponentModel.TypeConverter(typeof(SourceLocationTypeConverter))] + public partial class SourceLocation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SourceLocation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SourceLocation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SourceLocation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("FileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("AzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("AzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("FileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileStorageType = (string) content.GetValueForProperty("FileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SourceLocation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare) content.GetValueForProperty("FileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShareTypeConverter.ConvertFrom); + } + if (content.Contains("AzureBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlob = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob) content.GetValueForProperty("AzureBlob",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlob, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlobTypeConverter.ConvertFrom); + } + if (content.Contains("FileStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileStorageType = (string) content.GetValueForProperty("FileStorageType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileStorageType, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobAccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobAccountKey = (string) content.GetValueForProperty("AzureBlobAccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobAccountKey, global::System.Convert.ToString); + } + if (content.Contains("FileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePath = (string) content.GetValueForProperty("FileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePath, global::System.Convert.ToString); + } + if (content.Contains("FileShareUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShareUsername = (string) content.GetValueForProperty("FileShareUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileShareUsername, global::System.Convert.ToString); + } + if (content.Contains("FileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePassword = (System.Security.SecureString) content.GetValueForProperty("FileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).FileSharePassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AzureBlobStorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobStorageAccountResourceId = (string) content.GetValueForProperty("AzureBlobStorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobStorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureBlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobContainerName = (string) content.GetValueForProperty("AzureBlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal)this).AzureBlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Source Location details of backups. + [System.ComponentModel.TypeConverter(typeof(SourceLocationTypeConverter))] + public partial interface ISourceLocation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.TypeConverter.cs new file mode 100644 index 000000000000..b69f10c19f5a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SourceLocationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SourceLocation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SourceLocation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SourceLocation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.cs new file mode 100644 index 000000000000..10a1fde68186 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source Location details of backups. + public partial class SourceLocation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob _azureBlob; + + /// Source Azure Blob. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob AzureBlob { get => (this._azureBlob = this._azureBlob ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlob()); set => this._azureBlob = value; } + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobAccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)AzureBlob).AccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)AzureBlob).AccountKey = value ?? null; } + + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)AzureBlob).BlobContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)AzureBlob).BlobContainerName = value ?? null; } + + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureBlobStorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)AzureBlob).StorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlobInternal)AzureBlob).StorageAccountResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare _fileShare; + + /// Source File share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare FileShare { get => (this._fileShare = this._fileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShare()); set => this._fileShare = value; } + + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public System.Security.SecureString FileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)FileShare).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)FileShare).Password = value ?? null; } + + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)FileShare).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)FileShare).Path = value ?? null; } + + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string FileShareUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)FileShare).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)FileShare).Username = value ?? null; } + + /// Backing field for property. + private string _fileStorageType; + + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FileStorageType { get => this._fileStorageType; } + + /// Internal Acessors for AzureBlob + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal.AzureBlob { get => (this._azureBlob = this._azureBlob ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlob()); set { {_azureBlob = value;} } } + + /// Internal Acessors for FileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal.FileShare { get => (this._fileShare = this._fileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShare()); set { {_fileShare = value;} } } + + /// Internal Acessors for FileStorageType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocationInternal.FileStorageType { get => this._fileStorageType; set { {_fileStorageType = value;} } } + + /// Creates an new instance. + public SourceLocation() + { + + } + } + /// Source Location details of backups. + public partial interface ISourceLocation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureBlobStorageAccountResourceId { get; set; } + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string FileShareUsername { get; set; } + /// Backup storage Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup storage Type.", + SerializedName = @"fileStorageType", + PossibleTypes = new [] { typeof(string) })] + string FileStorageType { get; } + + } + /// Source Location details of backups. + internal partial interface ISourceLocationInternal + + { + /// Source Azure Blob. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureBlob AzureBlob { get; set; } + /// Storage Account Key. + string AzureBlobAccountKey { get; set; } + /// Blob container name where backups are stored. + string AzureBlobContainerName { get; set; } + /// Resource Id of the storage account where backups are stored. + string AzureBlobStorageAccountResourceId { get; set; } + /// Source File share. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare FileShare { get; set; } + /// Password for username to access file share location. + System.Security.SecureString FileSharePassword { get; set; } + /// Location as SMB share or local drive where backups are placed. + string FileSharePath { get; set; } + /// Username to access the file share location for backups. + string FileShareUsername { get; set; } + /// Backup storage Type. + string FileStorageType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.json.cs new file mode 100644 index 000000000000..341795cad223 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SourceLocation.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source Location details of backups. + public partial class SourceLocation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISourceLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SourceLocation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SourceLocation(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_fileShare = If( json?.PropertyT("fileShare"), out var __jsonFileShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlFileShare.FromJson(__jsonFileShare) : FileShare;} + {_azureBlob = If( json?.PropertyT("azureBlob"), out var __jsonAzureBlob) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureBlob.FromJson(__jsonAzureBlob) : AzureBlob;} + {_fileStorageType = If( json?.PropertyT("fileStorageType"), out var __jsonFileStorageType) ? (string)__jsonFileStorageType : (string)FileStorageType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._fileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._fileShare.ToJson(null,serializationMode) : null, "fileShare" ,container.Add ); + AddIf( null != this._azureBlob ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._azureBlob.ToJson(null,serializationMode) : null, "azureBlob" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._fileStorageType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileStorageType.ToString()) : null, "fileStorageType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.PowerShell.cs new file mode 100644 index 000000000000..eda725d86164 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information of backup file + [System.ComponentModel.TypeConverter(typeof(SqlBackupFileInfoTypeConverter))] + public partial class SqlBackupFileInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlBackupFileInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlBackupFileInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlBackupFileInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("TotalSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).TotalSize = (long?) content.GetValueForProperty("TotalSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).TotalSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataRead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataRead = (long?) content.GetValueForProperty("DataRead",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataRead, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataWritten")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataWritten = (long?) content.GetValueForProperty("DataWritten",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataWritten, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CopyThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyThroughput = (double?) content.GetValueForProperty("CopyThroughput",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyThroughput, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("CopyDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyDuration = (int?) content.GetValueForProperty("CopyDuration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FamilySequenceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FamilySequenceNumber = (int?) content.GetValueForProperty("FamilySequenceNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FamilySequenceNumber, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlBackupFileInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("TotalSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).TotalSize = (long?) content.GetValueForProperty("TotalSize",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).TotalSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataRead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataRead = (long?) content.GetValueForProperty("DataRead",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataRead, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DataWritten")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataWritten = (long?) content.GetValueForProperty("DataWritten",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).DataWritten, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CopyThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyThroughput = (double?) content.GetValueForProperty("CopyThroughput",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyThroughput, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("CopyDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyDuration = (int?) content.GetValueForProperty("CopyDuration",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).CopyDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FamilySequenceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FamilySequenceNumber = (int?) content.GetValueForProperty("FamilySequenceNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal)this).FamilySequenceNumber, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of backup file + [System.ComponentModel.TypeConverter(typeof(SqlBackupFileInfoTypeConverter))] + public partial interface ISqlBackupFileInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.TypeConverter.cs new file mode 100644 index 000000000000..794fc12fe029 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlBackupFileInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlBackupFileInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlBackupFileInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlBackupFileInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.cs new file mode 100644 index 000000000000..ced86f1db4a9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of backup file + public partial class SqlBackupFileInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal + { + + /// Backing field for property. + private int? _copyDuration; + + /// Copy Duration in seconds + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? CopyDuration { get => this._copyDuration; } + + /// Backing field for property. + private double? _copyThroughput; + + /// Copy throughput in KBps + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public double? CopyThroughput { get => this._copyThroughput; } + + /// Backing field for property. + private long? _dataRead; + + /// Bytes read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataRead { get => this._dataRead; } + + /// Backing field for property. + private long? _dataWritten; + + /// Bytes written + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? DataWritten { get => this._dataWritten; } + + /// Backing field for property. + private int? _familySequenceNumber; + + /// Media family sequence number + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? FamilySequenceNumber { get => this._familySequenceNumber; } + + /// Backing field for property. + private string _fileName; + + /// File name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FileName { get => this._fileName; } + + /// Internal Acessors for CopyDuration + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.CopyDuration { get => this._copyDuration; set { {_copyDuration = value;} } } + + /// Internal Acessors for CopyThroughput + double? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.CopyThroughput { get => this._copyThroughput; set { {_copyThroughput = value;} } } + + /// Internal Acessors for DataRead + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.DataRead { get => this._dataRead; set { {_dataRead = value;} } } + + /// Internal Acessors for DataWritten + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.DataWritten { get => this._dataWritten; set { {_dataWritten = value;} } } + + /// Internal Acessors for FamilySequenceNumber + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.FamilySequenceNumber { get => this._familySequenceNumber; set { {_familySequenceNumber = value;} } } + + /// Internal Acessors for FileName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.FileName { get => this._fileName; set { {_fileName = value;} } } + + /// Internal Acessors for Status + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TotalSize + long? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfoInternal.TotalSize { get => this._totalSize; set { {_totalSize = value;} } } + + /// Backing field for property. + private string _status; + + /// + /// Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Status { get => this._status; } + + /// Backing field for property. + private long? _totalSize; + + /// File size in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? TotalSize { get => this._totalSize; } + + /// Creates an new instance. + public SqlBackupFileInfo() + { + + } + } + /// Information of backup file + public partial interface ISqlBackupFileInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Copy Duration in seconds + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Copy Duration in seconds", + SerializedName = @"copyDuration", + PossibleTypes = new [] { typeof(int) })] + int? CopyDuration { get; } + /// Copy throughput in KBps + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Copy throughput in KBps", + SerializedName = @"copyThroughput", + PossibleTypes = new [] { typeof(double) })] + double? CopyThroughput { get; } + /// Bytes read + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Bytes read", + SerializedName = @"dataRead", + PossibleTypes = new [] { typeof(long) })] + long? DataRead { get; } + /// Bytes written + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Bytes written", + SerializedName = @"dataWritten", + PossibleTypes = new [] { typeof(long) })] + long? DataWritten { get; } + /// Media family sequence number + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Media family sequence number", + SerializedName = @"familySequenceNumber", + PossibleTypes = new [] { typeof(int) })] + int? FamilySequenceNumber { get; } + /// File name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"File name.", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + string FileName { get; } + /// + /// Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped)", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; } + /// File size in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"File size in bytes", + SerializedName = @"totalSize", + PossibleTypes = new [] { typeof(long) })] + long? TotalSize { get; } + + } + /// Information of backup file + internal partial interface ISqlBackupFileInfoInternal + + { + /// Copy Duration in seconds + int? CopyDuration { get; set; } + /// Copy throughput in KBps + double? CopyThroughput { get; set; } + /// Bytes read + long? DataRead { get; set; } + /// Bytes written + long? DataWritten { get; set; } + /// Media family sequence number + int? FamilySequenceNumber { get; set; } + /// File name. + string FileName { get; set; } + /// + /// Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped) + /// + string Status { get; set; } + /// File size in bytes + long? TotalSize { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.json.cs new file mode 100644 index 000000000000..e12ae4ee5409 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupFileInfo.json.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of backup file + public partial class SqlBackupFileInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlBackupFileInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlBackupFileInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_fileName = If( json?.PropertyT("fileName"), out var __jsonFileName) ? (string)__jsonFileName : (string)FileName;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_totalSize = If( json?.PropertyT("totalSize"), out var __jsonTotalSize) ? (long?)__jsonTotalSize : TotalSize;} + {_dataRead = If( json?.PropertyT("dataRead"), out var __jsonDataRead) ? (long?)__jsonDataRead : DataRead;} + {_dataWritten = If( json?.PropertyT("dataWritten"), out var __jsonDataWritten) ? (long?)__jsonDataWritten : DataWritten;} + {_copyThroughput = If( json?.PropertyT("copyThroughput"), out var __jsonCopyThroughput) ? (double?)__jsonCopyThroughput : CopyThroughput;} + {_copyDuration = If( json?.PropertyT("copyDuration"), out var __jsonCopyDuration) ? (int?)__jsonCopyDuration : CopyDuration;} + {_familySequenceNumber = If( json?.PropertyT("familySequenceNumber"), out var __jsonFamilySequenceNumber) ? (int?)__jsonFamilySequenceNumber : FamilySequenceNumber;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._fileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileName.ToString()) : null, "fileName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalSize ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._totalSize) : null, "totalSize" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataRead ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataRead) : null, "dataRead" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dataWritten ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataWritten) : null, "dataWritten" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._copyThroughput ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._copyThroughput) : null, "copyThroughput" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._copyDuration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._copyDuration) : null, "copyDuration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._familySequenceNumber ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._familySequenceNumber) : null, "familySequenceNumber" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.PowerShell.cs new file mode 100644 index 000000000000..9b9d57c5b7ee --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information of backup set + [System.ComponentModel.TypeConverter(typeof(SqlBackupSetInfoTypeConverter))] + public partial class SqlBackupSetInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlBackupSetInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlBackupSetInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlBackupSetInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupSetId = (string) content.GetValueForProperty("BackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FirstLsn = (string) content.GetValueForProperty("FirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).LastLsn = (string) content.GetValueForProperty("LastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).LastLsn, global::System.Convert.ToString); + } + if (content.Contains("BackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupType = (string) content.GetValueForProperty("BackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupType, global::System.Convert.ToString); + } + if (content.Contains("ListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).ListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[]) content.GetValueForProperty("ListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).ListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupStartDate = (global::System.DateTime?) content.GetValueForProperty("BackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("BackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IsBackupRestored = (bool?) content.GetValueForProperty("IsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasBackupChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).HasBackupChecksum = (bool?) content.GetValueForProperty("HasBackupChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).HasBackupChecksum, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FamilyCount = (int?) content.GetValueForProperty("FamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IgnoreReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IgnoreReason = (string[]) content.GetValueForProperty("IgnoreReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IgnoreReason, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlBackupSetInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupSetId = (string) content.GetValueForProperty("BackupSetId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupSetId, global::System.Convert.ToString); + } + if (content.Contains("FirstLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FirstLsn = (string) content.GetValueForProperty("FirstLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FirstLsn, global::System.Convert.ToString); + } + if (content.Contains("LastLsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).LastLsn = (string) content.GetValueForProperty("LastLsn",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).LastLsn, global::System.Convert.ToString); + } + if (content.Contains("BackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupType = (string) content.GetValueForProperty("BackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupType, global::System.Convert.ToString); + } + if (content.Contains("ListOfBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).ListOfBackupFile = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[]) content.GetValueForProperty("ListOfBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).ListOfBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupStartDate = (global::System.DateTime?) content.GetValueForProperty("BackupStartDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("BackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).BackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsBackupRestored")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IsBackupRestored = (bool?) content.GetValueForProperty("IsBackupRestored",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IsBackupRestored, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasBackupChecksum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).HasBackupChecksum = (bool?) content.GetValueForProperty("HasBackupChecksum",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).HasBackupChecksum, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FamilyCount = (int?) content.GetValueForProperty("FamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).FamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IgnoreReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IgnoreReason = (string[]) content.GetValueForProperty("IgnoreReason",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal)this).IgnoreReason, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of backup set + [System.ComponentModel.TypeConverter(typeof(SqlBackupSetInfoTypeConverter))] + public partial interface ISqlBackupSetInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.TypeConverter.cs new file mode 100644 index 000000000000..1086b9d6e8e9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlBackupSetInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlBackupSetInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlBackupSetInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlBackupSetInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.cs new file mode 100644 index 000000000000..98bd7d9da99c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of backup set + public partial class SqlBackupSetInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _backupFinishDate; + + /// Backup end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? BackupFinishDate { get => this._backupFinishDate; } + + /// Backing field for property. + private string _backupSetId; + + /// Backup set id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string BackupSetId { get => this._backupSetId; } + + /// Backing field for property. + private global::System.DateTime? _backupStartDate; + + /// Backup start date. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? BackupStartDate { get => this._backupStartDate; } + + /// Backing field for property. + private string _backupType; + + /// Backup type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string BackupType { get => this._backupType; } + + /// Backing field for property. + private int? _familyCount; + + /// Media family count + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? FamilyCount { get => this._familyCount; } + + /// Backing field for property. + private string _firstLsn; + + /// First LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FirstLsn { get => this._firstLsn; } + + /// Backing field for property. + private bool? _hasBackupChecksum; + + /// Has Backup Checksums + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? HasBackupChecksum { get => this._hasBackupChecksum; } + + /// Backing field for property. + private string[] _ignoreReason; + + /// The reasons why the backup set is ignored + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] IgnoreReason { get => this._ignoreReason; } + + /// Backing field for property. + private bool? _isBackupRestored; + + /// Whether this backup set has been restored or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? IsBackupRestored { get => this._isBackupRestored; } + + /// Backing field for property. + private string _lastLsn; + + /// Last LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LastLsn { get => this._lastLsn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] _listOfBackupFile; + + /// List of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] ListOfBackupFile { get => this._listOfBackupFile; } + + /// Internal Acessors for BackupFinishDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.BackupFinishDate { get => this._backupFinishDate; set { {_backupFinishDate = value;} } } + + /// Internal Acessors for BackupSetId + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.BackupSetId { get => this._backupSetId; set { {_backupSetId = value;} } } + + /// Internal Acessors for BackupStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.BackupStartDate { get => this._backupStartDate; set { {_backupStartDate = value;} } } + + /// Internal Acessors for BackupType + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.BackupType { get => this._backupType; set { {_backupType = value;} } } + + /// Internal Acessors for FamilyCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.FamilyCount { get => this._familyCount; set { {_familyCount = value;} } } + + /// Internal Acessors for FirstLsn + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.FirstLsn { get => this._firstLsn; set { {_firstLsn = value;} } } + + /// Internal Acessors for HasBackupChecksum + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.HasBackupChecksum { get => this._hasBackupChecksum; set { {_hasBackupChecksum = value;} } } + + /// Internal Acessors for IgnoreReason + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.IgnoreReason { get => this._ignoreReason; set { {_ignoreReason = value;} } } + + /// Internal Acessors for IsBackupRestored + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.IsBackupRestored { get => this._isBackupRestored; set { {_isBackupRestored = value;} } } + + /// Internal Acessors for LastLsn + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.LastLsn { get => this._lastLsn; set { {_lastLsn = value;} } } + + /// Internal Acessors for ListOfBackupFile + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfoInternal.ListOfBackupFile { get => this._listOfBackupFile; set { {_listOfBackupFile = value;} } } + + /// Creates an new instance. + public SqlBackupSetInfo() + { + + } + } + /// Information of backup set + public partial interface ISqlBackupSetInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Backup end time. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup end time.", + SerializedName = @"backupFinishDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BackupFinishDate { get; } + /// Backup set id. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup set id.", + SerializedName = @"backupSetId", + PossibleTypes = new [] { typeof(string) })] + string BackupSetId { get; } + /// Backup start date. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup start date.", + SerializedName = @"backupStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BackupStartDate { get; } + /// Backup type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup type.", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(string) })] + string BackupType { get; } + /// Media family count + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Media family count", + SerializedName = @"familyCount", + PossibleTypes = new [] { typeof(int) })] + int? FamilyCount { get; } + /// First LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"First LSN of the backup set.", + SerializedName = @"firstLSN", + PossibleTypes = new [] { typeof(string) })] + string FirstLsn { get; } + /// Has Backup Checksums + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Has Backup Checksums", + SerializedName = @"hasBackupChecksums", + PossibleTypes = new [] { typeof(bool) })] + bool? HasBackupChecksum { get; } + /// The reasons why the backup set is ignored + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reasons why the backup set is ignored", + SerializedName = @"ignoreReasons", + PossibleTypes = new [] { typeof(string) })] + string[] IgnoreReason { get; } + /// Whether this backup set has been restored or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether this backup set has been restored or not.", + SerializedName = @"isBackupRestored", + PossibleTypes = new [] { typeof(bool) })] + bool? IsBackupRestored { get; } + /// Last LSN of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last LSN of the backup set.", + SerializedName = @"lastLSN", + PossibleTypes = new [] { typeof(string) })] + string LastLsn { get; } + /// List of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of files in the backup set.", + SerializedName = @"listOfBackupFiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] ListOfBackupFile { get; } + + } + /// Information of backup set + internal partial interface ISqlBackupSetInfoInternal + + { + /// Backup end time. + global::System.DateTime? BackupFinishDate { get; set; } + /// Backup set id. + string BackupSetId { get; set; } + /// Backup start date. + global::System.DateTime? BackupStartDate { get; set; } + /// Backup type. + string BackupType { get; set; } + /// Media family count + int? FamilyCount { get; set; } + /// First LSN of the backup set. + string FirstLsn { get; set; } + /// Has Backup Checksums + bool? HasBackupChecksum { get; set; } + /// The reasons why the backup set is ignored + string[] IgnoreReason { get; set; } + /// Whether this backup set has been restored or not. + bool? IsBackupRestored { get; set; } + /// Last LSN of the backup set. + string LastLsn { get; set; } + /// List of files in the backup set. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo[] ListOfBackupFile { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.json.cs new file mode 100644 index 000000000000..ca3458cca274 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlBackupSetInfo.json.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information of backup set + public partial class SqlBackupSetInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupSetInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlBackupSetInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlBackupSetInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupSetId = If( json?.PropertyT("backupSetId"), out var __jsonBackupSetId) ? (string)__jsonBackupSetId : (string)BackupSetId;} + {_firstLsn = If( json?.PropertyT("firstLSN"), out var __jsonFirstLsn) ? (string)__jsonFirstLsn : (string)FirstLsn;} + {_lastLsn = If( json?.PropertyT("lastLSN"), out var __jsonLastLsn) ? (string)__jsonLastLsn : (string)LastLsn;} + {_backupType = If( json?.PropertyT("backupType"), out var __jsonBackupType) ? (string)__jsonBackupType : (string)BackupType;} + {_listOfBackupFile = If( json?.PropertyT("listOfBackupFiles"), out var __jsonListOfBackupFiles) ? If( __jsonListOfBackupFiles as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlBackupFileInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlBackupFileInfo.FromJson(__u) )) ))() : null : ListOfBackupFile;} + {_backupStartDate = If( json?.PropertyT("backupStartDate"), out var __jsonBackupStartDate) ? global::System.DateTime.TryParse((string)__jsonBackupStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBackupStartDateValue) ? __jsonBackupStartDateValue : BackupStartDate : BackupStartDate;} + {_backupFinishDate = If( json?.PropertyT("backupFinishDate"), out var __jsonBackupFinishDate) ? global::System.DateTime.TryParse((string)__jsonBackupFinishDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBackupFinishDateValue) ? __jsonBackupFinishDateValue : BackupFinishDate : BackupFinishDate;} + {_isBackupRestored = If( json?.PropertyT("isBackupRestored"), out var __jsonIsBackupRestored) ? (bool?)__jsonIsBackupRestored : IsBackupRestored;} + {_hasBackupChecksum = If( json?.PropertyT("hasBackupChecksums"), out var __jsonHasBackupChecksums) ? (bool?)__jsonHasBackupChecksums : HasBackupChecksum;} + {_familyCount = If( json?.PropertyT("familyCount"), out var __jsonFamilyCount) ? (int?)__jsonFamilyCount : FamilyCount;} + {_ignoreReason = If( json?.PropertyT("ignoreReasons"), out var __jsonIgnoreReasons) ? If( __jsonIgnoreReasons as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : IgnoreReason;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._backupSetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupSetId.ToString()) : null, "backupSetId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._firstLsn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._firstLsn.ToString()) : null, "firstLSN" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastLsn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastLsn.ToString()) : null, "lastLSN" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._backupType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupType.ToString()) : null, "backupType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._listOfBackupFile) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._listOfBackupFile ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("listOfBackupFiles",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._backupStartDate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupStartDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupStartDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._backupFinishDate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupFinishDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupFinishDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isBackupRestored ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isBackupRestored) : null, "isBackupRestored" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._hasBackupChecksum ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._hasBackupChecksum) : null, "hasBackupChecksums" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._familyCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._familyCount) : null, "familyCount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._ignoreReason) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._ignoreReason ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("ignoreReasons",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.PowerShell.cs new file mode 100644 index 000000000000..0e6514cba397 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.PowerShell.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Information for connecting to SQL database server + [System.ComponentModel.TypeConverter(typeof(SqlConnectionInfoTypeConverter))] + public partial class SqlConnectionInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlConnectionInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlConnectionInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlConnectionInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerBrandVersion = (string) content.GetValueForProperty("ServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Platform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Platform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("Platform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Platform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlConnectionInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerVersion = (string) content.GetValueForProperty("ServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerVersion, global::System.Convert.ToString); + } + if (content.Contains("ServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerBrandVersion = (string) content.GetValueForProperty("ServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).AdditionalSetting = (string) content.GetValueForProperty("AdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).AdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Platform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Platform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("Platform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)this).Platform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)this).Password, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information for connecting to SQL database server + [System.ComponentModel.TypeConverter(typeof(SqlConnectionInfoTypeConverter))] + public partial interface ISqlConnectionInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.TypeConverter.cs new file mode 100644 index 000000000000..3de61bf0978e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlConnectionInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlConnectionInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlConnectionInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlConnectionInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.cs new file mode 100644 index 000000000000..4e9fc61402fd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to SQL database server + public partial class SqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(); + + /// Backing field for property. + private string _additionalSetting; + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AdditionalSetting { get => this._additionalSetting; set => this._additionalSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? _authentication; + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get => this._authentication; set => this._authentication = value; } + + /// Backing field for property. + private string _dataSource; + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DataSource { get => this._dataSource; set => this._dataSource = value; } + + /// Backing field for property. + private bool? _encryptConnection; + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EncryptConnection { get => this._encryptConnection; set => this._encryptConnection = value; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Password = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? _platform; + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? Platform { get => this._platform; set => this._platform = value; } + + /// Backing field for property. + private int? _port; + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public int? Port { get => this._port; set => this._port = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _serverBrandVersion; + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerBrandVersion { get => this._serverBrandVersion; set => this._serverBrandVersion = value; } + + /// Backing field for property. + private string _serverName; + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Backing field for property. + private string _serverVersion; + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServerVersion { get => this._serverVersion; set => this._serverVersion = value; } + + /// Backing field for property. + private bool? _trustServerCertificate; + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? TrustServerCertificate { get => this._trustServerCertificate; set => this._trustServerCertificate = value; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)__connectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public SqlConnectionInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__connectionInfo), __connectionInfo); + await eventListener.AssertObjectIsValid(nameof(__connectionInfo), __connectionInfo); + } + } + /// Information for connecting to SQL database server + public partial interface ISqlConnectionInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfo + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string DataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? EncryptConnection { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? Platform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? Port { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string ServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TrustServerCertificate { get; set; } + + } + /// Information for connecting to SQL database server + internal partial interface ISqlConnectionInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal + { + /// Additional connection settings + string AdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? Authentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string DataSource { get; set; } + /// Whether to encrypt the connection + bool? EncryptConnection { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? Platform { get; set; } + /// Port for Server + int? Port { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string ResourceId { get; set; } + /// server brand version + string ServerBrandVersion { get; set; } + /// name of the server + string ServerName { get; set; } + /// server version + string ServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TrustServerCertificate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.json.cs new file mode 100644 index 000000000000..93928bd58817 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInfo.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Information for connecting to SQL database server + public partial class SqlConnectionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlConnectionInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlConnectionInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __connectionInfo = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ConnectionInfo(json); + {_dataSource = If( json?.PropertyT("dataSource"), out var __jsonDataSource) ? (string)__jsonDataSource : (string)DataSource;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int?)__jsonPort : Port;} + {_serverVersion = If( json?.PropertyT("serverVersion"), out var __jsonServerVersion) ? (string)__jsonServerVersion : (string)ServerVersion;} + {_serverBrandVersion = If( json?.PropertyT("serverBrandVersion"), out var __jsonServerBrandVersion) ? (string)__jsonServerBrandVersion : (string)ServerBrandVersion;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_authentication = If( json?.PropertyT("authentication"), out var __jsonAuthentication) ? (string)__jsonAuthentication : (string)Authentication;} + {_encryptConnection = If( json?.PropertyT("encryptConnection"), out var __jsonEncryptConnection) ? (bool?)__jsonEncryptConnection : EncryptConnection;} + {_additionalSetting = If( json?.PropertyT("additionalSettings"), out var __jsonAdditionalSettings) ? (string)__jsonAdditionalSettings : (string)AdditionalSetting;} + {_trustServerCertificate = If( json?.PropertyT("trustServerCertificate"), out var __jsonTrustServerCertificate) ? (bool?)__jsonTrustServerCertificate : TrustServerCertificate;} + {_platform = If( json?.PropertyT("platform"), out var __jsonPlatform) ? (string)__jsonPlatform : (string)Platform;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __connectionInfo?.ToJson(container, serializationMode); + AddIf( null != (((object)this._dataSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataSource.ToString()) : null, "dataSource" ,container.Add ); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._port) : null, "port" ,container.Add ); + AddIf( null != (((object)this._serverVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverVersion.ToString()) : null, "serverVersion" ,container.Add ); + AddIf( null != (((object)this._serverBrandVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serverBrandVersion.ToString()) : null, "serverBrandVersion" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._authentication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authentication.ToString()) : null, "authentication" ,container.Add ); + AddIf( null != this._encryptConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._encryptConnection) : null, "encryptConnection" ,container.Add ); + AddIf( null != (((object)this._additionalSetting)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._additionalSetting.ToString()) : null, "additionalSettings" ,container.Add ); + AddIf( null != this._trustServerCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._trustServerCertificate) : null, "trustServerCertificate" ,container.Add ); + AddIf( null != (((object)this._platform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._platform.ToString()) : null, "platform" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.PowerShell.cs new file mode 100644 index 000000000000..0f1da80421d1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Source SQL Connection + [System.ComponentModel.TypeConverter(typeof(SqlConnectionInformationTypeConverter))] + public partial class SqlConnectionInformation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlConnectionInformation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlConnectionInformation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlConnectionInformation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Authentication = (string) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Authentication, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlConnectionInformation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).DataSource = (string) content.GetValueForProperty("DataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).DataSource, global::System.Convert.ToString); + } + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Authentication = (string) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Authentication, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("EncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).EncryptConnection = (bool?) content.GetValueForProperty("EncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).EncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).TrustServerCertificate = (bool?) content.GetValueForProperty("TrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal)this).TrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Source SQL Connection + [System.ComponentModel.TypeConverter(typeof(SqlConnectionInformationTypeConverter))] + public partial interface ISqlConnectionInformation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.TypeConverter.cs new file mode 100644 index 000000000000..ae0f111f7554 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlConnectionInformationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlConnectionInformation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlConnectionInformation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlConnectionInformation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.cs new file mode 100644 index 000000000000..8b19158489a3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source SQL Connection + public partial class SqlConnectionInformation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformationInternal + { + + /// Backing field for property. + private string _authentication; + + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Authentication { get => this._authentication; set => this._authentication = value; } + + /// Backing field for property. + private string _dataSource; + + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DataSource { get => this._dataSource; set => this._dataSource = value; } + + /// Backing field for property. + private bool? _encryptConnection; + + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? EncryptConnection { get => this._encryptConnection; set => this._encryptConnection = value; } + + /// Backing field for property. + private System.Security.SecureString _password; + + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public System.Security.SecureString Password { get => this._password; set => this._password = value; } + + /// Backing field for property. + private bool? _trustServerCertificate; + + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? TrustServerCertificate { get => this._trustServerCertificate; set => this._trustServerCertificate = value; } + + /// Backing field for property. + private string _userName; + + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string UserName { get => this._userName; set => this._userName = value; } + + /// Creates an new instance. + public SqlConnectionInformation() + { + + } + } + /// Source SQL Connection + public partial interface ISqlConnectionInformation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + string Authentication { get; set; } + /// Data source. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string DataSource { get; set; } + /// Whether to encrypt connection or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? EncryptConnection { get; set; } + /// Password to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString Password { get; set; } + /// Whether to trust server certificate or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TrustServerCertificate { get; set; } + /// User name to connect to source SQL. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string UserName { get; set; } + + } + /// Source SQL Connection + internal partial interface ISqlConnectionInformationInternal + + { + /// Authentication type. + string Authentication { get; set; } + /// Data source. + string DataSource { get; set; } + /// Whether to encrypt connection or not. + bool? EncryptConnection { get; set; } + /// Password to connect to source SQL. + System.Security.SecureString Password { get; set; } + /// Whether to trust server certificate or not. + bool? TrustServerCertificate { get; set; } + /// User name to connect to source SQL. + string UserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.json.cs new file mode 100644 index 000000000000..e5374b4fff64 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlConnectionInformation.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Source SQL Connection + public partial class SqlConnectionInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlConnectionInformation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlConnectionInformation(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dataSource = If( json?.PropertyT("dataSource"), out var __jsonDataSource) ? (string)__jsonDataSource : (string)DataSource;} + {_authentication = If( json?.PropertyT("authentication"), out var __jsonAuthentication) ? (string)__jsonAuthentication : (string)Authentication;} + {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)UserName;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : Password;} + {_encryptConnection = If( json?.PropertyT("encryptConnection"), out var __jsonEncryptConnection) ? (bool?)__jsonEncryptConnection : EncryptConnection;} + {_trustServerCertificate = If( json?.PropertyT("trustServerCertificate"), out var __jsonTrustServerCertificate) ? (bool?)__jsonTrustServerCertificate : TrustServerCertificate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._dataSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataSource.ToString()) : null, "dataSource" ,container.Add ); + AddIf( null != (((object)this._authentication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authentication.ToString()) : null, "authentication" ,container.Add ); + AddIf( null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._password))) : null, "password" ,container.Add ); + AddIf( null != this._encryptConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._encryptConnection) : null, "encryptConnection" ,container.Add ); + AddIf( null != this._trustServerCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._trustServerCertificate) : null, "trustServerCertificate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.PowerShell.cs new file mode 100644 index 000000000000..bf3c771c156c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Detailed status of current Sql Db migration. + [System.ComponentModel.TypeConverter(typeof(SqlDbMigrationStatusDetailsTypeConverter))] + public partial class SqlDbMigrationStatusDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlDbMigrationStatusDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlDbMigrationStatusDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlDbMigrationStatusDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).MigrationState = (string) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).MigrationState, global::System.Convert.ToString); + } + if (content.Contains("SqlDataCopyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).SqlDataCopyError = (string[]) content.GetValueForProperty("SqlDataCopyError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).SqlDataCopyError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ListOfCopyProgressDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).ListOfCopyProgressDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[]) content.GetValueForProperty("ListOfCopyProgressDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).ListOfCopyProgressDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetailsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlDbMigrationStatusDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).MigrationState = (string) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).MigrationState, global::System.Convert.ToString); + } + if (content.Contains("SqlDataCopyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).SqlDataCopyError = (string[]) content.GetValueForProperty("SqlDataCopyError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).SqlDataCopyError, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ListOfCopyProgressDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).ListOfCopyProgressDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[]) content.GetValueForProperty("ListOfCopyProgressDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal)this).ListOfCopyProgressDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetailsTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Detailed status of current Sql Db migration. + [System.ComponentModel.TypeConverter(typeof(SqlDbMigrationStatusDetailsTypeConverter))] + public partial interface ISqlDbMigrationStatusDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.TypeConverter.cs new file mode 100644 index 000000000000..92d809dec7f1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlDbMigrationStatusDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlDbMigrationStatusDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlDbMigrationStatusDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlDbMigrationStatusDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.cs new file mode 100644 index 000000000000..a521b9bc91cb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Detailed status of current Sql Db migration. + public partial class SqlDbMigrationStatusDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] _listOfCopyProgressDetail; + + /// Details on progress of ADF copy activities. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] ListOfCopyProgressDetail { get => this._listOfCopyProgressDetail; } + + /// Internal Acessors for ListOfCopyProgressDetail + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal.ListOfCopyProgressDetail { get => this._listOfCopyProgressDetail; set { {_listOfCopyProgressDetail = value;} } } + + /// Internal Acessors for MigrationState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for SqlDataCopyError + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetailsInternal.SqlDataCopyError { get => this._sqlDataCopyError; set { {_sqlDataCopyError = value;} } } + + /// Backing field for property. + private string _migrationState; + + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string MigrationState { get => this._migrationState; } + + /// Backing field for property. + private string[] _sqlDataCopyError; + + /// Sql Data Copy errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SqlDataCopyError { get => this._sqlDataCopyError; } + + /// Creates an new instance. + public SqlDbMigrationStatusDetails() + { + + } + } + /// Detailed status of current Sql Db migration. + public partial interface ISqlDbMigrationStatusDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Details on progress of ADF copy activities. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Details on progress of ADF copy activities.", + SerializedName = @"listOfCopyProgressDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] ListOfCopyProgressDetail { get; } + /// Current State of Migration. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current State of Migration.", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(string) })] + string MigrationState { get; } + /// Sql Data Copy errors, if any. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Sql Data Copy errors, if any.", + SerializedName = @"sqlDataCopyErrors", + PossibleTypes = new [] { typeof(string) })] + string[] SqlDataCopyError { get; } + + } + /// Detailed status of current Sql Db migration. + internal partial interface ISqlDbMigrationStatusDetailsInternal + + { + /// Details on progress of ADF copy activities. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails[] ListOfCopyProgressDetail { get; set; } + /// Current State of Migration. + string MigrationState { get; set; } + /// Sql Data Copy errors, if any. + string[] SqlDataCopyError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.json.cs new file mode 100644 index 000000000000..e2e14ee6f68b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbMigrationStatusDetails.json.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Detailed status of current Sql Db migration. + public partial class SqlDbMigrationStatusDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbMigrationStatusDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlDbMigrationStatusDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlDbMigrationStatusDetails(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + {_sqlDataCopyError = If( json?.PropertyT("sqlDataCopyErrors"), out var __jsonSqlDataCopyErrors) ? If( __jsonSqlDataCopyErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SqlDataCopyError;} + {_listOfCopyProgressDetail = If( json?.PropertyT("listOfCopyProgressDetails"), out var __jsonListOfCopyProgressDetails) ? If( __jsonListOfCopyProgressDetails as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICopyProgressDetails) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CopyProgressDetails.FromJson(__p) )) ))() : null : ListOfCopyProgressDetail;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._sqlDataCopyError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._sqlDataCopyError ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("sqlDataCopyErrors",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._listOfCopyProgressDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._listOfCopyProgressDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("listOfCopyProgressDetails",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.PowerShell.cs new file mode 100644 index 000000000000..bb3948e1dc6b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Offline configuration + [System.ComponentModel.TypeConverter(typeof(SqlDbOfflineConfigurationTypeConverter))] + public partial class SqlDbOfflineConfiguration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlDbOfflineConfiguration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlDbOfflineConfiguration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlDbOfflineConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Offline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal)this).Offline = (bool?) content.GetValueForProperty("Offline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal)this).Offline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlDbOfflineConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Offline")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal)this).Offline = (bool?) content.GetValueForProperty("Offline",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal)this).Offline, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Offline configuration + [System.ComponentModel.TypeConverter(typeof(SqlDbOfflineConfigurationTypeConverter))] + public partial interface ISqlDbOfflineConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..dcb6a9146491 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlDbOfflineConfigurationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlDbOfflineConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlDbOfflineConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlDbOfflineConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.cs new file mode 100644 index 000000000000..345f6d5ad6a5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Offline configuration + public partial class SqlDbOfflineConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal + { + + /// Internal Acessors for Offline + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfigurationInternal.Offline { get => this._offline; set { {_offline = value;} } } + + /// Backing field for property. + private bool? _offline; + + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public bool? Offline { get => this._offline; } + + /// Creates an new instance. + public SqlDbOfflineConfiguration() + { + + } + } + /// Offline configuration + public partial interface ISqlDbOfflineConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Offline migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(bool) })] + bool? Offline { get; } + + } + /// Offline configuration + internal partial interface ISqlDbOfflineConfigurationInternal + + { + /// Offline migration + bool? Offline { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.json.cs new file mode 100644 index 000000000000..acfa56ca6613 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlDbOfflineConfiguration.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Offline configuration + public partial class SqlDbOfflineConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlDbOfflineConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlDbOfflineConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlDbOfflineConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_offline = If( json?.PropertyT("offline"), out var __jsonOffline) ? (bool?)__jsonOffline : Offline;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._offline ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._offline) : null, "offline" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.PowerShell.cs new file mode 100644 index 000000000000..9a160cbfba9e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// File share + [System.ComponentModel.TypeConverter(typeof(SqlFileShareTypeConverter))] + public partial class SqlFileShare + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlFileShare(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlFileShare(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlFileShare(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Path, global::System.Convert.ToString); + } + if (content.Contains("Username")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Username, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlFileShare(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Path, global::System.Convert.ToString); + } + if (content.Contains("Username")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Username, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// File share + [System.ComponentModel.TypeConverter(typeof(SqlFileShareTypeConverter))] + public partial interface ISqlFileShare + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.TypeConverter.cs new file mode 100644 index 000000000000..981308e26a6e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlFileShareTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlFileShare.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlFileShare.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlFileShare.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.cs new file mode 100644 index 000000000000..5a1330be19e1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// File share + public partial class SqlFileShare : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShareInternal + { + + /// Backing field for property. + private System.Security.SecureString _password; + + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public System.Security.SecureString Password { get => this._password; set => this._password = value; } + + /// Backing field for property. + private string _path; + + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Backing field for property. + private string _username; + + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Username { get => this._username; set => this._username = value; } + + /// Creates an new instance. + public SqlFileShare() + { + + } + } + /// File share + public partial interface ISqlFileShare : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Password for username to access file share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString Password { get; set; } + /// Location as SMB share or local drive where backups are placed. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Username to access the file share location for backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string Username { get; set; } + + } + /// File share + internal partial interface ISqlFileShareInternal + + { + /// Password for username to access file share location. + System.Security.SecureString Password { get; set; } + /// Location as SMB share or local drive where backups are placed. + string Path { get; set; } + /// Username to access the file share location for backups. + string Username { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.json.cs new file mode 100644 index 000000000000..308b91c7464e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlFileShare.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// File share + public partial class SqlFileShare + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlFileShare FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlFileShare(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlFileShare(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)Username;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : Password;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + AddIf( null != (((object)this._username)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._username.ToString()) : null, "username" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._password))) : null, "password" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.PowerShell.cs new file mode 100644 index 000000000000..46ea871c3c6f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A list of SQL Migration Service. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationListResultTypeConverter))] + public partial class SqlMigrationListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlMigrationListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlMigrationListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlMigrationListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlMigrationListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A list of SQL Migration Service. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationListResultTypeConverter))] + public partial interface ISqlMigrationListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.TypeConverter.cs new file mode 100644 index 000000000000..178df9ae9098 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlMigrationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlMigrationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlMigrationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlMigrationListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.cs new file mode 100644 index 000000000000..e33ae35477d0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A list of SQL Migration Service. + public partial class SqlMigrationListResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService[] _value; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService[] Value { get => this._value; } + + /// Creates an new instance. + public SqlMigrationListResult() + { + + } + } + /// A list of SQL Migration Service. + public partial interface ISqlMigrationListResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService[] Value { get; } + + } + /// A list of SQL Migration Service. + internal partial interface ISqlMigrationListResultInternal + + { + string NextLink { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.json.cs new file mode 100644 index 000000000000..c3f1cf8b702f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationListResult.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A list of SQL Migration Service. + public partial class SqlMigrationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlMigrationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlMigrationListResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationService.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.PowerShell.cs new file mode 100644 index 000000000000..67f4ba3846ca --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.PowerShell.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// A SQL Migration Service. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServiceTypeConverter))] + public partial class SqlMigrationService + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlMigrationService(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlMigrationService(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlMigrationService(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("IntegrationRuntimeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).IntegrationRuntimeState = (string) content.GetValueForProperty("IntegrationRuntimeState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).IntegrationRuntimeState, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlMigrationService(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("IntegrationRuntimeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).IntegrationRuntimeState = (string) content.GetValueForProperty("IntegrationRuntimeState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal)this).IntegrationRuntimeState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A SQL Migration Service. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServiceTypeConverter))] + public partial interface ISqlMigrationService + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.TypeConverter.cs new file mode 100644 index 000000000000..8cf64d51110a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlMigrationServiceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlMigrationService.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlMigrationService.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlMigrationService.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.cs new file mode 100644 index 000000000000..d322a9070f61 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A SQL Migration Service. + public partial class SqlMigrationService : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource(); + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id; } + + /// Current state of the Integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string IntegrationRuntimeState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)Property).IntegrationRuntimeState; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for IntegrationRuntimeState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal.IntegrationRuntimeState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)Property).IntegrationRuntimeState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)Property).IntegrationRuntimeState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties _property; + + /// The SQL Migration Service properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceProperties()); set => this._property = value; } + + /// Provisioning state to track the async operation status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)Property).ProvisioningState; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemData; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public SqlMigrationService() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// A SQL Migration Service. + public partial interface ISqlMigrationService : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource + { + /// Current state of the Integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of the Integration runtime.", + SerializedName = @"integrationRuntimeState", + PossibleTypes = new [] { typeof(string) })] + string IntegrationRuntimeState { get; } + /// Provisioning state to track the async operation status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state to track the async operation status.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + + } + /// A SQL Migration Service. + internal partial interface ISqlMigrationServiceInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal + { + /// Current state of the Integration runtime. + string IntegrationRuntimeState { get; set; } + /// The SQL Migration Service properties. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties Property { get; set; } + /// Provisioning state to track the async operation status. + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.json.cs new file mode 100644 index 000000000000..9518df21a838 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationService.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// A SQL Migration Service. + public partial class SqlMigrationService + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlMigrationService(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlMigrationService(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..0e1f8f488e3e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// The SQL Migration Service properties. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServicePropertiesTypeConverter))] + public partial class SqlMigrationServiceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlMigrationServiceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlMigrationServiceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlMigrationServiceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("IntegrationRuntimeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).IntegrationRuntimeState = (string) content.GetValueForProperty("IntegrationRuntimeState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).IntegrationRuntimeState, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlMigrationServiceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("IntegrationRuntimeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).IntegrationRuntimeState = (string) content.GetValueForProperty("IntegrationRuntimeState",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal)this).IntegrationRuntimeState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The SQL Migration Service properties. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServicePropertiesTypeConverter))] + public partial interface ISqlMigrationServiceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..e0e8e43ed6e9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlMigrationServicePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlMigrationServiceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlMigrationServiceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlMigrationServiceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.cs new file mode 100644 index 000000000000..89f819d8a95b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// The SQL Migration Service properties. + public partial class SqlMigrationServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal + { + + /// Backing field for property. + private string _integrationRuntimeState; + + /// Current state of the Integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string IntegrationRuntimeState { get => this._integrationRuntimeState; } + + /// Internal Acessors for IntegrationRuntimeState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal.IntegrationRuntimeState { get => this._integrationRuntimeState; set { {_integrationRuntimeState = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// Provisioning state to track the async operation status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Creates an new instance. + public SqlMigrationServiceProperties() + { + + } + } + /// The SQL Migration Service properties. + public partial interface ISqlMigrationServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Current state of the Integration runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of the Integration runtime.", + SerializedName = @"integrationRuntimeState", + PossibleTypes = new [] { typeof(string) })] + string IntegrationRuntimeState { get; } + /// Provisioning state to track the async operation status. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state to track the async operation status.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + + } + /// The SQL Migration Service properties. + internal partial interface ISqlMigrationServicePropertiesInternal + + { + /// Current state of the Integration runtime. + string IntegrationRuntimeState { get; set; } + /// Provisioning state to track the async operation status. + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.json.cs new file mode 100644 index 000000000000..c37b5870fd05 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceProperties.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// The SQL Migration Service properties. + public partial class SqlMigrationServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlMigrationServiceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlMigrationServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_integrationRuntimeState = If( json?.PropertyT("integrationRuntimeState"), out var __jsonIntegrationRuntimeState) ? (string)__jsonIntegrationRuntimeState : (string)IntegrationRuntimeState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._integrationRuntimeState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._integrationRuntimeState.ToString()) : null, "integrationRuntimeState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.PowerShell.cs new file mode 100644 index 000000000000..9a75304aa83e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// An update to a SQL Migration Service. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServiceUpdateTypeConverter))] + public partial class SqlMigrationServiceUpdate + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlMigrationServiceUpdate(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlMigrationServiceUpdate(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlMigrationServiceUpdate(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdateTagsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlMigrationServiceUpdate(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdateTagsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An update to a SQL Migration Service. + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServiceUpdateTypeConverter))] + public partial interface ISqlMigrationServiceUpdate + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.TypeConverter.cs new file mode 100644 index 000000000000..b07678fd2cd9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlMigrationServiceUpdateTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlMigrationServiceUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlMigrationServiceUpdate.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlMigrationServiceUpdate.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.cs new file mode 100644 index 000000000000..c61142d5a3a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An update to a SQL Migration Service. + public partial class SqlMigrationServiceUpdate : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags _tag; + + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdateTags()); set => this._tag = value; } + + /// Creates an new instance. + public SqlMigrationServiceUpdate() + { + + } + } + /// An update to a SQL Migration Service. + public partial interface ISqlMigrationServiceUpdate : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags Tag { get; set; } + + } + /// An update to a SQL Migration Service. + internal partial interface ISqlMigrationServiceUpdateInternal + + { + /// Dictionary of + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.json.cs new file mode 100644 index 000000000000..42da14e8e3d9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdate.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// An update to a SQL Migration Service. + public partial class SqlMigrationServiceUpdate + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlMigrationServiceUpdate(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlMigrationServiceUpdate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdateTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.PowerShell.cs new file mode 100644 index 000000000000..1f5e67016439 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServiceUpdateTagsTypeConverter))] + public partial class SqlMigrationServiceUpdateTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlMigrationServiceUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlMigrationServiceUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlMigrationServiceUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlMigrationServiceUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(SqlMigrationServiceUpdateTagsTypeConverter))] + public partial interface ISqlMigrationServiceUpdateTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.TypeConverter.cs new file mode 100644 index 000000000000..8f40ff6b3808 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlMigrationServiceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlMigrationServiceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlMigrationServiceUpdateTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlMigrationServiceUpdateTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.cs new file mode 100644 index 000000000000..180e3be7fd4e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class SqlMigrationServiceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTagsInternal + { + + /// Creates an new instance. + public SqlMigrationServiceUpdateTags() + { + + } + } + /// Dictionary of + public partial interface ISqlMigrationServiceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Dictionary of + internal partial interface ISqlMigrationServiceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.dictionary.cs new file mode 100644 index 000000000000..effa7cc76d9d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class SqlMigrationServiceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.json.cs new file mode 100644 index 000000000000..a59a126c7bba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationServiceUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class SqlMigrationServiceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlMigrationServiceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal SqlMigrationServiceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.PowerShell.cs new file mode 100644 index 000000000000..973cf8c1f136 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.PowerShell.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Base class for migration task input + [System.ComponentModel.TypeConverter(typeof(SqlMigrationTaskInputTypeConverter))] + public partial class SqlMigrationTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlMigrationTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlMigrationTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlMigrationTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlMigrationTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for migration task input + [System.ComponentModel.TypeConverter(typeof(SqlMigrationTaskInputTypeConverter))] + public partial interface ISqlMigrationTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..93f1e407153d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlMigrationTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlMigrationTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlMigrationTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlMigrationTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.cs new file mode 100644 index 000000000000..a08046895d98 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for migration task input + public partial class SqlMigrationTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _sourceConnectionInfo; + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public SqlMigrationTaskInput() + { + + } + } + /// Base class for migration task input + public partial interface ISqlMigrationTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Base class for migration task input + internal partial interface ISqlMigrationTaskInputInternal + + { + /// Information for connecting to source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Information for connecting to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.json.cs new file mode 100644 index 000000000000..0b426e8a0946 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlMigrationTaskInput.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Base class for migration task input + public partial class SqlMigrationTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlMigrationTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlMigrationTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..b3de681ee074 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.PowerShell.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + [System.ComponentModel.TypeConverter(typeof(SqlServerSqlMiSyncTaskInputTypeConverter))] + public partial class SqlServerSqlMiSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlServerSqlMiSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlServerSqlMiSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlServerSqlMiSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId, global::System.Convert.ToString); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlServerSqlMiSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId, global::System.Convert.ToString); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + [System.ComponentModel.TypeConverter(typeof(SqlServerSqlMiSyncTaskInputTypeConverter))] + public partial interface ISqlServerSqlMiSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..321a201f397e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlServerSqlMiSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlServerSqlMiSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlServerSqlMiSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlServerSqlMiSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.cs new file mode 100644 index 000000000000..c96b1c0c4a01 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.cs @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + public partial class SqlServerSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp _azureApp; + + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureApp { get => (this._azureApp = this._azureApp ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp()); set => this._azureApp = value; } + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).ApplicationId = value ?? null; } + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? AzureAppIgnoreAzurePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).IgnoreAzurePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).IgnoreAzurePermission = value ?? default(bool); } + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).AppKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).AppKey = value ?? null; } + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string AzureAppTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryAppInternal)AzureApp).TenantId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare _backupFileShare; + + /// Backup file share information for all selected databases. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set => this._backupFileShare = value; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName = value ?? null; } + + /// Internal Acessors for AzureApp + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal.AzureApp { get => (this._azureApp = this._azureApp ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp()); set { {_azureApp = value;} } } + + /// Internal Acessors for BackupFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal.BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set { {_backupFileShare = value;} } } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _sourceConnectionInfo; + + /// Connection information for source SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private string _storageResourceId; + + /// Fully qualified resourceId of storage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StorageResourceId { get => this._storageResourceId; set => this._storageResourceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo _targetConnectionInfo; + + /// Connection information for Azure SQL Database Managed Instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoManagedInstanceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)TargetConnectionInfo).ManagedInstanceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfoInternal)TargetConnectionInfo).ManagedInstanceResourceId = value ; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// Creates an new instance. + public SqlServerSqlMiSyncTaskInput() + { + + } + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + public partial interface ISqlServerSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string AzureAppApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureAppIgnoreAzurePermission { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + string AzureAppKey { get; set; } + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureAppTenantId { get; set; } + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string BackupFileShareUserName { get; set; } + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Fully qualified resourceId of storage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Fully qualified resourceId of storage", + SerializedName = @"storageResourceId", + PossibleTypes = new [] { typeof(string) })] + string StorageResourceId { get; set; } + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource id for Azure SQL database Managed instance", + SerializedName = @"managedInstanceResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoManagedInstanceResourceId { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + internal partial interface ISqlServerSqlMiSyncTaskInputInternal + + { + /// + /// 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 + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureApp { get; set; } + /// Application ID of the Azure Active Directory Application + string AzureAppApplicationId { get; set; } + /// Ignore checking azure permissions on the AAD app + bool? AzureAppIgnoreAzurePermission { get; set; } + /// Key used to authenticate to the Azure Active Directory Application + string AzureAppKey { get; set; } + /// Tenant id of the customer + string AzureAppTenantId { get; set; } + /// Backup file share information for all selected databases. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get; set; } + /// Password credential used to connect to the share location. + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + string BackupFileShareUserName { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get; set; } + /// Connection information for source SQL Server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Fully qualified resourceId of storage + string StorageResourceId { get; set; } + /// Connection information for Azure SQL Database Managed Instance + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo TargetConnectionInfo { get; set; } + /// Resource id for Azure SQL database Managed instance + string TargetConnectionInfoManagedInstanceResourceId { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.json.cs new file mode 100644 index 000000000000..8652735140bf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SqlServerSqlMiSyncTaskInput.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + public partial class SqlServerSqlMiSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SqlServerSqlMiSyncTaskInput(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SqlServerSqlMiSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupFileShare = If( json?.PropertyT("backupFileShare"), out var __jsonBackupFileShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare.FromJson(__jsonBackupFileShare) : BackupFileShare;} + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_azureApp = If( json?.PropertyT("azureApp"), out var __jsonAzureApp) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryApp.FromJson(__jsonAzureApp) : AzureApp;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + {_storageResourceId = If( json?.PropertyT("storageResourceId"), out var __jsonStorageResourceId) ? (string)__jsonStorageResourceId : (string)StorageResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._backupFileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupFileShare.ToJson(null,serializationMode) : null, "backupFileShare" ,container.Add ); + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._azureApp ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._azureApp.ToJson(null,serializationMode) : null, "azureApp" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AddIf( null != (((object)this._storageResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._storageResourceId.ToString()) : null, "storageResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.PowerShell.cs new file mode 100644 index 000000000000..b7bd41eb088a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// SSIS migration info with SSIS store type, overwrite policy. + [System.ComponentModel.TypeConverter(typeof(SsisMigrationInfoTypeConverter))] + public partial class SsisMigrationInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SsisMigrationInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SsisMigrationInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SsisMigrationInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SsisStoreType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).SsisStoreType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType?) content.GetValueForProperty("SsisStoreType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).SsisStoreType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType.CreateFrom); + } + if (content.Contains("ProjectOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).ProjectOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("ProjectOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).ProjectOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + if (content.Contains("EnvironmentOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).EnvironmentOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("EnvironmentOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).EnvironmentOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SsisMigrationInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SsisStoreType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).SsisStoreType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType?) content.GetValueForProperty("SsisStoreType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).SsisStoreType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType.CreateFrom); + } + if (content.Contains("ProjectOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).ProjectOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("ProjectOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).ProjectOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + if (content.Contains("EnvironmentOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).EnvironmentOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption?) content.GetValueForProperty("EnvironmentOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal)this).EnvironmentOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// SSIS migration info with SSIS store type, overwrite policy. + [System.ComponentModel.TypeConverter(typeof(SsisMigrationInfoTypeConverter))] + public partial interface ISsisMigrationInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.TypeConverter.cs new file mode 100644 index 000000000000..42f86c59a186 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SsisMigrationInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SsisMigrationInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SsisMigrationInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SsisMigrationInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.cs new file mode 100644 index 000000000000..29bf476b8178 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// SSIS migration info with SSIS store type, overwrite policy. + public partial class SsisMigrationInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? _environmentOverwriteOption; + + /// The overwrite option for the SSIS environment migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? EnvironmentOverwriteOption { get => this._environmentOverwriteOption; set => this._environmentOverwriteOption = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? _projectOverwriteOption; + + /// The overwrite option for the SSIS project migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? ProjectOverwriteOption { get => this._projectOverwriteOption; set => this._projectOverwriteOption = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType? _ssisStoreType; + + /// The SSIS store type of source, only SSIS catalog is supported now in DMS + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType? SsisStoreType { get => this._ssisStoreType; set => this._ssisStoreType = value; } + + /// Creates an new instance. + public SsisMigrationInfo() + { + + } + } + /// SSIS migration info with SSIS store type, overwrite policy. + public partial interface ISsisMigrationInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The overwrite option for the SSIS environment migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The overwrite option for the SSIS environment migration", + SerializedName = @"environmentOverwriteOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? EnvironmentOverwriteOption { get; set; } + /// The overwrite option for the SSIS project migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The overwrite option for the SSIS project migration", + SerializedName = @"projectOverwriteOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? ProjectOverwriteOption { get; set; } + /// The SSIS store type of source, only SSIS catalog is supported now in DMS + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SSIS store type of source, only SSIS catalog is supported now in DMS", + SerializedName = @"ssisStoreType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType? SsisStoreType { get; set; } + + } + /// SSIS migration info with SSIS store type, overwrite policy. + internal partial interface ISsisMigrationInfoInternal + + { + /// The overwrite option for the SSIS environment migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? EnvironmentOverwriteOption { get; set; } + /// The overwrite option for the SSIS project migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption? ProjectOverwriteOption { get; set; } + /// The SSIS store type of source, only SSIS catalog is supported now in DMS + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType? SsisStoreType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.json.cs new file mode 100644 index 000000000000..b5ef19b90bc7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SsisMigrationInfo.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// SSIS migration info with SSIS store type, overwrite policy. + public partial class SsisMigrationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISsisMigrationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SsisMigrationInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SsisMigrationInfo(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ssisStoreType = If( json?.PropertyT("ssisStoreType"), out var __jsonSsisStoreType) ? (string)__jsonSsisStoreType : (string)SsisStoreType;} + {_projectOverwriteOption = If( json?.PropertyT("projectOverwriteOption"), out var __jsonProjectOverwriteOption) ? (string)__jsonProjectOverwriteOption : (string)ProjectOverwriteOption;} + {_environmentOverwriteOption = If( json?.PropertyT("environmentOverwriteOption"), out var __jsonEnvironmentOverwriteOption) ? (string)__jsonEnvironmentOverwriteOption : (string)EnvironmentOverwriteOption;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._ssisStoreType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._ssisStoreType.ToString()) : null, "ssisStoreType" ,container.Add ); + AddIf( null != (((object)this._projectOverwriteOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._projectOverwriteOption.ToString()) : null, "projectOverwriteOption" ,container.Add ); + AddIf( null != (((object)this._environmentOverwriteOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._environmentOverwriteOption.ToString()) : null, "environmentOverwriteOption" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.PowerShell.cs new file mode 100644 index 000000000000..552a052a199e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.PowerShell.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Server role migration result + [System.ComponentModel.TypeConverter(typeof(StartMigrationScenarioServerRoleResultTypeConverter))] + public partial class StartMigrationScenarioServerRoleResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StartMigrationScenarioServerRoleResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StartMigrationScenarioServerRoleResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StartMigrationScenarioServerRoleResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StartMigrationScenarioServerRoleResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState.CreateFrom); + } + if (content.Contains("ExceptionsAndWarning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).ExceptionsAndWarning = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExceptionsAndWarning",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal)this).ExceptionsAndWarning, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Server role migration result + [System.ComponentModel.TypeConverter(typeof(StartMigrationScenarioServerRoleResultTypeConverter))] + public partial interface IStartMigrationScenarioServerRoleResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.TypeConverter.cs new file mode 100644 index 000000000000..6a8494341ac1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StartMigrationScenarioServerRoleResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StartMigrationScenarioServerRoleResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StartMigrationScenarioServerRoleResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StartMigrationScenarioServerRoleResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.cs new file mode 100644 index 000000000000..88ef98485ae6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Server role migration result + public partial class StartMigrationScenarioServerRoleResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _exceptionsAndWarning; + + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get => this._exceptionsAndWarning; } + + /// Internal Acessors for ExceptionsAndWarning + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal.ExceptionsAndWarning { get => this._exceptionsAndWarning; set { {_exceptionsAndWarning = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResultInternal.State { get => this._state; set { {_state = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of server role. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? _state; + + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get => this._state; } + + /// Creates an new instance. + public StartMigrationScenarioServerRoleResult() + { + + } + } + /// Server role migration result + public partial interface IStartMigrationScenarioServerRoleResult : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Migration exceptions and warnings. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Migration exceptions and warnings.", + SerializedName = @"exceptionsAndWarnings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; } + /// Name of server role. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of server role.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Current state of migration + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of migration", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; } + + } + /// Server role migration result + internal partial interface IStartMigrationScenarioServerRoleResultInternal + + { + /// Migration exceptions and warnings. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExceptionsAndWarning { get; set; } + /// Name of server role. + string Name { get; set; } + /// Current state of migration + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.json.cs new file mode 100644 index 000000000000..9c1b6c6d1fc1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/StartMigrationScenarioServerRoleResult.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Server role migration result + public partial class StartMigrationScenarioServerRoleResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IStartMigrationScenarioServerRoleResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new StartMigrationScenarioServerRoleResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal StartMigrationScenarioServerRoleResult(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_exceptionsAndWarning = If( json?.PropertyT("exceptionsAndWarnings"), out var __jsonExceptionsAndWarnings) ? If( __jsonExceptionsAndWarnings as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ExceptionsAndWarning;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._exceptionsAndWarning) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._exceptionsAndWarning ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("exceptionsAndWarnings",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.PowerShell.cs new file mode 100644 index 000000000000..6fa4b0d9e754 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Database migration errors for online migration + [System.ComponentModel.TypeConverter(typeof(SyncMigrationDatabaseErrorEventTypeConverter))] + public partial class SyncMigrationDatabaseErrorEvent + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SyncMigrationDatabaseErrorEvent(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SyncMigrationDatabaseErrorEvent(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SyncMigrationDatabaseErrorEvent(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimestampString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).TimestampString = (string) content.GetValueForProperty("TimestampString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).TimestampString, global::System.Convert.ToString); + } + if (content.Contains("EventTypeString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventTypeString = (string) content.GetValueForProperty("EventTypeString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventTypeString, global::System.Convert.ToString); + } + if (content.Contains("EventText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventText = (string) content.GetValueForProperty("EventText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventText, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SyncMigrationDatabaseErrorEvent(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimestampString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).TimestampString = (string) content.GetValueForProperty("TimestampString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).TimestampString, global::System.Convert.ToString); + } + if (content.Contains("EventTypeString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventTypeString = (string) content.GetValueForProperty("EventTypeString",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventTypeString, global::System.Convert.ToString); + } + if (content.Contains("EventText")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventText = (string) content.GetValueForProperty("EventText",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal)this).EventText, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Database migration errors for online migration + [System.ComponentModel.TypeConverter(typeof(SyncMigrationDatabaseErrorEventTypeConverter))] + public partial interface ISyncMigrationDatabaseErrorEvent + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.TypeConverter.cs new file mode 100644 index 000000000000..2ad747bfda1b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SyncMigrationDatabaseErrorEventTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SyncMigrationDatabaseErrorEvent.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SyncMigrationDatabaseErrorEvent.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SyncMigrationDatabaseErrorEvent.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.cs new file mode 100644 index 000000000000..d4842fbc7d27 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database migration errors for online migration + public partial class SyncMigrationDatabaseErrorEvent : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal + { + + /// Backing field for property. + private string _eventText; + + /// Event text. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EventText { get => this._eventText; } + + /// Backing field for property. + private string _eventTypeString; + + /// Event type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string EventTypeString { get => this._eventTypeString; } + + /// Internal Acessors for EventText + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal.EventText { get => this._eventText; set { {_eventText = value;} } } + + /// Internal Acessors for EventTypeString + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal.EventTypeString { get => this._eventTypeString; set { {_eventTypeString = value;} } } + + /// Internal Acessors for TimestampString + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEventInternal.TimestampString { get => this._timestampString; set { {_timestampString = value;} } } + + /// Backing field for property. + private string _timestampString; + + /// String value of timestamp. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TimestampString { get => this._timestampString; } + + /// Creates an new instance. + public SyncMigrationDatabaseErrorEvent() + { + + } + } + /// Database migration errors for online migration + public partial interface ISyncMigrationDatabaseErrorEvent : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Event text. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Event text.", + SerializedName = @"eventText", + PossibleTypes = new [] { typeof(string) })] + string EventText { get; } + /// Event type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Event type.", + SerializedName = @"eventTypeString", + PossibleTypes = new [] { typeof(string) })] + string EventTypeString { get; } + /// String value of timestamp. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"String value of timestamp.", + SerializedName = @"timestampString", + PossibleTypes = new [] { typeof(string) })] + string TimestampString { get; } + + } + /// Database migration errors for online migration + internal partial interface ISyncMigrationDatabaseErrorEventInternal + + { + /// Event text. + string EventText { get; set; } + /// Event type. + string EventTypeString { get; set; } + /// String value of timestamp. + string TimestampString { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.json.cs new file mode 100644 index 000000000000..ff7fa3a8d5e7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SyncMigrationDatabaseErrorEvent.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Database migration errors for online migration + public partial class SyncMigrationDatabaseErrorEvent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISyncMigrationDatabaseErrorEvent FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SyncMigrationDatabaseErrorEvent(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SyncMigrationDatabaseErrorEvent(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timestampString = If( json?.PropertyT("timestampString"), out var __jsonTimestampString) ? (string)__jsonTimestampString : (string)TimestampString;} + {_eventTypeString = If( json?.PropertyT("eventTypeString"), out var __jsonEventTypeString) ? (string)__jsonEventTypeString : (string)EventTypeString;} + {_eventText = If( json?.PropertyT("eventText"), out var __jsonEventText) ? (string)__jsonEventText : (string)EventText;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._timestampString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._timestampString.ToString()) : null, "timestampString" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eventTypeString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._eventTypeString.ToString()) : null, "eventTypeString" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eventText)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._eventText.ToString()) : null, "eventText" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.PowerShell.cs new file mode 100644 index 000000000000..7325e29e2f4f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial class SystemData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial interface ISystemData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..a3625dba3b9c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.cs new file mode 100644 index 000000000000..f772570dc232 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class SystemData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } + + /// Backing field for property. + private string _createdBy; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? _createdByType; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedAt; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } + + /// Backing field for property. + private string _lastModifiedBy; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? _lastModifiedByType; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + + /// Creates an new instance. + public SystemData() + { + + } + } + public partial interface ISystemData : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string CreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? CreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string LastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? LastModifiedByType { get; set; } + + } + internal partial interface ISystemDataInternal + + { + global::System.DateTime? CreatedAt { get; set; } + + string CreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? CreatedByType { get; set; } + + global::System.DateTime? LastModifiedAt { get; set; } + + string LastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? LastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.json.cs new file mode 100644 index 000000000000..9f1843b16022 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/SystemData.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class SystemData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new SystemData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); + AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.PowerShell.cs new file mode 100644 index 000000000000..956b97e3af23 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Target Location details for optional copy of backups + [System.ComponentModel.TypeConverter(typeof(TargetLocationTypeConverter))] + public partial class TargetLocation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TargetLocation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TargetLocation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TargetLocation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).AccountKey = (string) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).AccountKey, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TargetLocation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).AccountKey = (string) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal)this).AccountKey, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Target Location details for optional copy of backups + [System.ComponentModel.TypeConverter(typeof(TargetLocationTypeConverter))] + public partial interface ITargetLocation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.TypeConverter.cs new file mode 100644 index 000000000000..79efe3c487d6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TargetLocationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TargetLocation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TargetLocation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TargetLocation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.cs new file mode 100644 index 000000000000..6509e204c267 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target Location details for optional copy of backups + public partial class TargetLocation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocationInternal + { + + /// Backing field for property. + private string _accountKey; + + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string AccountKey { get => this._accountKey; set => this._accountKey = value; } + + /// Backing field for property. + private string _storageAccountResourceId; + + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string StorageAccountResourceId { get => this._storageAccountResourceId; set => this._storageAccountResourceId = value; } + + /// Creates an new instance. + public TargetLocation() + { + + } + } + /// Target Location details for optional copy of backups + public partial interface ITargetLocation : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Storage Account Key. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + string AccountKey { get; set; } + /// Resource Id of the storage account copying backups. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountResourceId { get; set; } + + } + /// Target Location details for optional copy of backups + internal partial interface ITargetLocationInternal + + { + /// Storage Account Key. + string AccountKey { get; set; } + /// Resource Id of the storage account copying backups. + string StorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.json.cs new file mode 100644 index 000000000000..955f54f6f7f5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TargetLocation.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Target Location details for optional copy of backups + public partial class TargetLocation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITargetLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new TargetLocation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal TargetLocation(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageAccountResourceId = If( json?.PropertyT("storageAccountResourceId"), out var __jsonStorageAccountResourceId) ? (string)__jsonStorageAccountResourceId : (string)StorageAccountResourceId;} + {_accountKey = If( json?.PropertyT("accountKey"), out var __jsonAccountKey) ? (string)__jsonAccountKey : (string)AccountKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._storageAccountResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._storageAccountResourceId.ToString()) : null, "storageAccountResourceId" ,container.Add ); + AddIf( null != (((object)this._accountKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._accountKey.ToString()) : null, "accountKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.PowerShell.cs new file mode 100644 index 000000000000..13735da6301c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// OData page of tasks + [System.ComponentModel.TypeConverter(typeof(TaskListTypeConverter))] + public partial class TaskList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TaskList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TaskList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TaskList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TaskList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OData page of tasks + [System.ComponentModel.TypeConverter(typeof(TaskListTypeConverter))] + public partial interface ITaskList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.TypeConverter.cs new file mode 100644 index 000000000000..ca4f9fc49e7a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TaskListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TaskList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TaskList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TaskList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.cs new file mode 100644 index 000000000000..88163c3232e5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of tasks + public partial class TaskList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to load the next page of tasks + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask[] _value; + + /// List of tasks + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TaskList() + { + + } + } + /// OData page of tasks + public partial interface ITaskList : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// URL to load the next page of tasks + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to load the next page of tasks", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of tasks + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask[] Value { get; set; } + + } + /// OData page of tasks + internal partial interface ITaskListInternal + + { + /// URL to load the next page of tasks + string NextLink { get; set; } + /// List of tasks + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.json.cs new file mode 100644 index 000000000000..9304e367fcd4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TaskList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// OData page of tasks + public partial class TaskList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITaskList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new TaskList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal TaskList(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.PowerShell.cs new file mode 100644 index 000000000000..be482b8adae2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial class TrackedResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial interface ITrackedResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.TypeConverter.cs new file mode 100644 index 000000000000..f55c0afc5484 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.cs new file mode 100644 index 000000000000..19029a8ab7b4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class TrackedResource : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal + { + + /// Backing field for property. + private string _id; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData _systemData; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData()); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags _tag; + + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTags()); set => this._tag = value; } + + /// Backing field for property. + private string _type; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public TrackedResource() + { + + } + } + public partial interface ITrackedResource : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Dictionary of + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + internal partial interface ITrackedResourceInternal + + { + string Id { get; set; } + + string Location { get; set; } + + string Name { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISystemData SystemData { get; set; } + + global::System.DateTime? SystemDataCreatedAt { get; set; } + + string SystemDataCreatedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataCreatedByType { get; set; } + + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + + string SystemDataLastModifiedBy { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Dictionary of + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get; set; } + + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.json.cs new file mode 100644 index 000000000000..44e65b9fb008 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResource.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class TrackedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTags.FromJson(__jsonTags) : Tag;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.PowerShell.cs new file mode 100644 index 000000000000..8c3b3653bee6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResourceTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResourceTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Dictionary of + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..eaf38f5e9cc8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.cs new file mode 100644 index 000000000000..518ed3c436be --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Dictionary of + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + + } + /// Dictionary of + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.dictionary.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.dictionary.cs new file mode 100644 index 000000000000..9dd518695c2b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.json.cs new file mode 100644 index 000000000000..7f0ef2271928 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/TrackedResourceTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Dictionary of + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.PowerShell.cs new file mode 100644 index 000000000000..dafffe8101d8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for the service task to upload an OCI driver. + [System.ComponentModel.TypeConverter(typeof(UploadOciDriverTaskInputTypeConverter))] + public partial class UploadOciDriverTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UploadOciDriverTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UploadOciDriverTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UploadOciDriverTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("DriverShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("DriverShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShareUserName = (string) content.GetValueForProperty("DriverShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShareUserName, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePassword = (string) content.GetValueForProperty("DriverSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePassword, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePath = (string) content.GetValueForProperty("DriverSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePath, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UploadOciDriverTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("DriverShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("DriverShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShareUserName = (string) content.GetValueForProperty("DriverShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverShareUserName, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePassword = (string) content.GetValueForProperty("DriverSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePassword, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePath = (string) content.GetValueForProperty("DriverSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)this).DriverSharePath, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Input for the service task to upload an OCI driver. + [System.ComponentModel.TypeConverter(typeof(UploadOciDriverTaskInputTypeConverter))] + public partial interface IUploadOciDriverTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..7f63acba25b1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UploadOciDriverTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UploadOciDriverTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UploadOciDriverTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UploadOciDriverTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.cs new file mode 100644 index 000000000000..351f5d048d4b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the service task to upload an OCI driver. + public partial class UploadOciDriverTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare _driverShare; + + /// File share information for the OCI driver archive. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare DriverShare { get => (this._driverShare = this._driverShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set => this._driverShare = value; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DriverSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)DriverShare).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)DriverShare).Password = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DriverSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)DriverShare).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)DriverShare).Path = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DriverShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)DriverShare).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)DriverShare).UserName = value ?? null; } + + /// Internal Acessors for DriverShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal.DriverShare { get => (this._driverShare = this._driverShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set { {_driverShare = value;} } } + + /// Creates an new instance. + public UploadOciDriverTaskInput() + { + + } + } + /// Input for the service task to upload an OCI driver. + public partial interface IUploadOciDriverTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string DriverSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string DriverSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string DriverShareUserName { get; set; } + + } + /// Input for the service task to upload an OCI driver. + internal partial interface IUploadOciDriverTaskInputInternal + + { + /// File share information for the OCI driver archive. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare DriverShare { get; set; } + /// Password credential used to connect to the share location. + string DriverSharePassword { get; set; } + /// The folder path for this share. + string DriverSharePath { get; set; } + /// User name credential to connect to the share location + string DriverShareUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.json.cs new file mode 100644 index 000000000000..ea4d50867a34 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskInput.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for the service task to upload an OCI driver. + public partial class UploadOciDriverTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new UploadOciDriverTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._driverShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._driverShare.ToJson(null,serializationMode) : null, "driverShare" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal UploadOciDriverTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_driverShare = If( json?.PropertyT("driverShare"), out var __jsonDriverShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare.FromJson(__jsonDriverShare) : DriverShare;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..8a87b48265ec --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output for the service task to upload an OCI driver. + [System.ComponentModel.TypeConverter(typeof(UploadOciDriverTaskOutputTypeConverter))] + public partial class UploadOciDriverTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UploadOciDriverTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UploadOciDriverTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UploadOciDriverTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverPackageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).DriverPackageName = (string) content.GetValueForProperty("DriverPackageName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).DriverPackageName, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UploadOciDriverTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DriverPackageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).DriverPackageName = (string) content.GetValueForProperty("DriverPackageName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).DriverPackageName, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Output for the service task to upload an OCI driver. + [System.ComponentModel.TypeConverter(typeof(UploadOciDriverTaskOutputTypeConverter))] + public partial interface IUploadOciDriverTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..1f6de97967c4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UploadOciDriverTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UploadOciDriverTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UploadOciDriverTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UploadOciDriverTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.cs new file mode 100644 index 000000000000..245add03c676 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the service task to upload an OCI driver. + public partial class UploadOciDriverTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal + { + + /// Backing field for property. + private string _driverPackageName; + + /// The name of the driver package that was validated and uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string DriverPackageName { get => this._driverPackageName; } + + /// Internal Acessors for DriverPackageName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal.DriverPackageName { get => this._driverPackageName; set { {_driverPackageName = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// Creates an new instance. + public UploadOciDriverTaskOutput() + { + + } + } + /// Output for the service task to upload an OCI driver. + public partial interface IUploadOciDriverTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// The name of the driver package that was validated and uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the driver package that was validated and uploaded.", + SerializedName = @"driverPackageName", + PossibleTypes = new [] { typeof(string) })] + string DriverPackageName { get; } + /// Validation errors + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Validation errors", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for the service task to upload an OCI driver. + internal partial interface IUploadOciDriverTaskOutputInternal + + { + /// The name of the driver package that was validated and uploaded. + string DriverPackageName { get; set; } + /// Validation errors + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.json.cs new file mode 100644 index 000000000000..3acb275b0982 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskOutput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for the service task to upload an OCI driver. + public partial class UploadOciDriverTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new UploadOciDriverTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._driverPackageName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._driverPackageName.ToString()) : null, "driverPackageName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal UploadOciDriverTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_driverPackageName = If( json?.PropertyT("driverPackageName"), out var __jsonDriverPackageName) ? (string)__jsonDriverPackageName : (string)DriverPackageName;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..86d4facbc1df --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that uploads an OCI driver. + [System.ComponentModel.TypeConverter(typeof(UploadOciDriverTaskPropertiesTypeConverter))] + public partial class UploadOciDriverTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UploadOciDriverTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UploadOciDriverTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UploadOciDriverTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputDriverShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).InputDriverShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("InputDriverShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).InputDriverShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("DriverShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverShareUserName = (string) content.GetValueForProperty("DriverShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverShareUserName, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePassword = (string) content.GetValueForProperty("DriverSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePassword, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePath = (string) content.GetValueForProperty("DriverSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePath, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UploadOciDriverTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + if (content.Contains("InputDriverShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).InputDriverShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("InputDriverShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).InputDriverShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("DriverShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverShareUserName = (string) content.GetValueForProperty("DriverShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverShareUserName, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePassword = (string) content.GetValueForProperty("DriverSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePassword, global::System.Convert.ToString); + } + if (content.Contains("DriverSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePath = (string) content.GetValueForProperty("DriverSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal)this).DriverSharePath, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Properties for the task that uploads an OCI driver. + [System.ComponentModel.TypeConverter(typeof(UploadOciDriverTaskPropertiesTypeConverter))] + public partial interface IUploadOciDriverTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..bb882392f2ba --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UploadOciDriverTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UploadOciDriverTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UploadOciDriverTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UploadOciDriverTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.cs new file mode 100644 index 000000000000..2a49f34c8aa0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that uploads an OCI driver. + public partial class UploadOciDriverTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DriverSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverSharePassword = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DriverSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverSharePath = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DriverShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverShareUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverShareUserName = value ?? null; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput _input; + + /// Input for the service task to upload an OCI driver. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskInput()); set => this._input = value; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Internal Acessors for Input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal.Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskInput()); set { {_input = value;} } } + + /// Internal Acessors for InputDriverShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal.InputDriverShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInputInternal)Input).DriverShare = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Creates an new instance. + public UploadOciDriverTaskProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + } + /// Properties for the task that uploads an OCI driver. + public partial interface IUploadOciDriverTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string DriverSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string DriverSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string DriverShareUserName { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput[] Output { get; } + + } + /// Properties for the task that uploads an OCI driver. + internal partial interface IUploadOciDriverTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Password credential used to connect to the share location. + string DriverSharePassword { get; set; } + /// The folder path for this share. + string DriverSharePath { get; set; } + /// User name credential to connect to the share location + string DriverShareUserName { get; set; } + /// Input for the service task to upload an OCI driver. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskInput Input { get; set; } + /// File share information for the OCI driver archive. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare InputDriverShare { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.json.cs new file mode 100644 index 000000000000..79ba81d56b75 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/UploadOciDriverTaskProperties.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that uploads an OCI driver. + public partial class UploadOciDriverTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new UploadOciDriverTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal UploadOciDriverTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskInput.FromJson(__jsonInput) : Input;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IUploadOciDriverTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.UploadOciDriverTaskOutput.FromJson(__u) )) ))() : null : Output;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..2d3c9fed1e0d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL DB sync migrations + /// + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesTypeConverter))] + public partial class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + } + /// Properties for task that validates migration input for SQL to Azure SQL DB sync migrations + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesTypeConverter))] + public partial interface IValidateMigrationInputSqlServerSqlDbSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..be19081bb2cf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.cs new file mode 100644 index 000000000000..0226c554e151 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL DB sync migrations + /// + public partial class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskInput()); set => this._input = value; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + + /// + /// Creates an new instance. + /// + public ValidateMigrationInputSqlServerSqlDbSyncTaskProperties() + { + + } + } + /// Properties for task that validates migration input for SQL to Azure SQL DB sync migrations + public partial interface IValidateMigrationInputSqlServerSqlDbSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput[] Output { get; } + + } + /// Properties for task that validates migration input for SQL to Azure SQL DB sync migrations + internal partial interface IValidateMigrationInputSqlServerSqlDbSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.json.cs new file mode 100644 index 000000000000..2f2499b537c0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL DB sync migrations + /// + public partial class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlDbSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateSyncMigrationInputSqlServerTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.PowerShell.cs new file mode 100644 index 000000000000..4e8d047e5efd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.PowerShell.cs @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiSyncTaskInputTypeConverter))] + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMigrationInputSqlServerSqlMiSyncTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMigrationInputSqlServerSqlMiSyncTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoManagedInstanceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId = (string) content.GetValueForProperty("TargetConnectionInfoManagedInstanceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfoManagedInstanceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId = (string) content.GetValueForProperty("AzureAppApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey = (string) content.GetValueForProperty("AzureAppKey",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppKey, global::System.Convert.ToString); + } + if (content.Contains("AzureAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId = (string) content.GetValueForProperty("AzureAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureAppIgnoreAzurePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission = (bool?) content.GetValueForProperty("AzureAppIgnoreAzurePermission",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureAppIgnoreAzurePermission, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MiSqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureApp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp) content.GetValueForProperty("AzureApp",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).AzureApp, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.AzureActiveDirectoryAppTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)this).StorageResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiSyncTaskInputTypeConverter))] + public partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..71451dbade0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.cs new file mode 100644 index 000000000000..308f4487e052 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInputInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput __sqlServerSqlMiSyncTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput(); + + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAzureActiveDirectoryApp AzureApp { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureApp; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureApp = value ; } + + /// Application ID of the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string AzureAppApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppApplicationId = value ?? null; } + + /// Ignore checking azure permissions on the AAD app + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? AzureAppIgnoreAzurePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppIgnoreAzurePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppIgnoreAzurePermission = value ?? default(bool); } + + /// Key used to authenticate to the Azure Active Directory Application + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string AzureAppKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppKey = value ?? null; } + + /// Tenant id of the customer + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string AzureAppTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).AzureAppTenantId = value ?? null; } + + /// Backup file share information for all selected databases. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShare; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShare = value ?? null /* model class */; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePassword = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileSharePath = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShareUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).BackupFileShareUserName = value ?? null; } + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SelectedDatabase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SelectedDatabase = value ; } + + /// Connection information for source SQL Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfo = value ; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoAuthentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoDataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoDataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoEncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoEncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPassword = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoPort = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoTrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoTrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).SourceConnectionInfoUserName = value ?? null; } + + /// Fully qualified resourceId of storage + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string StorageResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).StorageResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).StorageResourceId = value ; } + + /// Connection information for Azure SQL Database Managed Instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMiSqlConnectionInfo TargetConnectionInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfo = value ; } + + /// Resource id for Azure SQL database Managed instance + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoManagedInstanceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoManagedInstanceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoManagedInstanceResourceId = value ; } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoPassword = value ?? null; } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoType = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal)__sqlServerSqlMiSyncTaskInput).TargetConnectionInfoUserName = value ?? null; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__sqlServerSqlMiSyncTaskInput), __sqlServerSqlMiSyncTaskInput); + await eventListener.AssertObjectIsValid(nameof(__sqlServerSqlMiSyncTaskInput), __sqlServerSqlMiSyncTaskInput); + } + + /// + /// Creates an new instance. + /// + public ValidateMigrationInputSqlServerSqlMiSyncTaskInput() + { + + } + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + public partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput + { + + } + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + internal partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskInputInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInputInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.json.cs new file mode 100644 index 000000000000..c6d92f8f6d93 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskInput.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMigrationInputSqlServerSqlMiSyncTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __sqlServerSqlMiSyncTaskInput?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __sqlServerSqlMiSyncTaskInput = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput(json); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..39a460d2c869 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for task that validates migration input for Azure SQL Database Managed Instance online migration + /// + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiSyncTaskOutputTypeConverter))] + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMigrationInputSqlServerSqlMiSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMigrationInputSqlServerSqlMiSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Output for task that validates migration input for Azure SQL Database Managed Instance online migration + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiSyncTaskOutputTypeConverter))] + public partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..e62b5ced3b6a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.cs new file mode 100644 index 000000000000..d80ad007706e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that validates migration input for Azure SQL Database Managed Instance online migration + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Database identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Errors associated with a selected database object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ValidateMigrationInputSqlServerSqlMiSyncTaskOutput() + { + + } + } + /// Output for task that validates migration input for Azure SQL Database Managed Instance online migration + public partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Database identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Errors associated with a selected database object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with a selected database object", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for task that validates migration input for Azure SQL Database Managed Instance online migration + internal partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskOutputInternal + + { + /// Database identifier + string Id { get; set; } + /// Name of database + string Name { get; set; } + /// Errors associated with a selected database object + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.json.cs new file mode 100644 index 000000000000..eaa36e28d9d4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that validates migration input for Azure SQL Database Managed Instance online migration + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMigrationInputSqlServerSqlMiSyncTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..32def321ed9f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario + /// + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesTypeConverter))] + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMigrationInputSqlServerSqlMiSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMigrationInputSqlServerSqlMiSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + } + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesTypeConverter))] + public partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..42df36377b3b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.cs new file mode 100644 index 000000000000..9f082061015b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + + /// + /// Creates an new instance. + /// + public ValidateMigrationInputSqlServerSqlMiSyncTaskProperties() + { + + } + } + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario + public partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput[] Output { get; } + + } + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario + internal partial interface IValidateMigrationInputSqlServerSqlMiSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlServerSqlMiSyncTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.json.cs new file mode 100644 index 000000000000..2af7e95820d9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiSyncTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario + /// + public partial class ValidateMigrationInputSqlServerSqlMiSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMigrationInputSqlServerSqlMiSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMigrationInputSqlServerSqlMiSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlServerSqlMiSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.PowerShell.cs new file mode 100644 index 000000000000..6d76ecc75ca2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.PowerShell.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Input for task that validates migration input for SQL to Azure SQL Managed Instance + /// + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiTaskInputTypeConverter))] + public partial class ValidateMigrationInputSqlServerSqlMiTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMigrationInputSqlServerSqlMiTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMigrationInputSqlServerSqlMiTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMigrationInputSqlServerSqlMiTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("BackupBlobShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare) content.GetValueForProperty("BackupBlobShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShareTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SelectedLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedLogin = (string[]) content.GetValueForProperty("SelectedLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedLogin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BackupMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupMode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode?) content.GetValueForProperty("BackupMode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupMode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode.CreateFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("BackupBlobShareSasUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri = (string) content.GetValueForProperty("BackupBlobShareSasUri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMigrationInputSqlServerSqlMiTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BackupFileShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare) content.GetValueForProperty("BackupFileShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("BackupBlobShare")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShare = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare) content.GetValueForProperty("BackupBlobShare",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShare, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShareTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SelectedLogin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedLogin = (string[]) content.GetValueForProperty("SelectedLogin",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SelectedLogin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BackupMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupMode = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode?) content.GetValueForProperty("BackupMode",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupMode, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode.CreateFrom); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("BackupFileShareUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName = (string) content.GetValueForProperty("BackupFileShareUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileShareUserName, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword = (string) content.GetValueForProperty("BackupFileSharePassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePassword, global::System.Convert.ToString); + } + if (content.Contains("BackupFileSharePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath = (string) content.GetValueForProperty("BackupFileSharePath",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupFileSharePath, global::System.Convert.ToString); + } + if (content.Contains("BackupBlobShareSasUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri = (string) content.GetValueForProperty("BackupBlobShareSasUri",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal)this).BackupBlobShareSasUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Input for task that validates migration input for SQL to Azure SQL Managed Instance + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiTaskInputTypeConverter))] + public partial interface IValidateMigrationInputSqlServerSqlMiTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..4d848d7dc48f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMigrationInputSqlServerSqlMiTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.cs new file mode 100644 index 000000000000..1fe99f185ba7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.cs @@ -0,0 +1,597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that validates migration input for SQL to Azure SQL Managed Instance + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare _backupBlobShare; + + /// SAS URI of Azure Storage Account Container to be used for storing backup files. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare BackupBlobShare { get => (this._backupBlobShare = this._backupBlobShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare()); set => this._backupBlobShare = value; } + + /// SAS URI of Azure Storage Account Container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupBlobShareSasUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)BackupBlobShare).SasUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShareInternal)BackupBlobShare).SasUri = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare _backupFileShare; + + /// Backup file share information for all selected databases. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set => this._backupFileShare = value; } + + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Password = value ?? null; } + + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileSharePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).Path = value ?? null; } + + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string BackupFileShareUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShareInternal)BackupFileShare).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? _backupMode; + + /// Backup Mode to specify whether to use existing backup or create new backup. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? BackupMode { get => this._backupMode; set => this._backupMode = value; } + + /// Internal Acessors for BackupBlobShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal.BackupBlobShare { get => (this._backupBlobShare = this._backupBlobShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare()); set { {_backupBlobShare = value;} } } + + /// Internal Acessors for BackupFileShare + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal.BackupFileShare { get => (this._backupFileShare = this._backupFileShare ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare()); set { {_backupFileShare = value;} } } + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private string[] _selectedLogin; + + /// Logins to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string[] SelectedLogin { get => this._selectedLogin; set => this._selectedLogin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _sourceConnectionInfo; + + /// Information for connecting to source + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public ValidateMigrationInputSqlServerSqlMiTaskInput() + { + + } + } + /// Input for task that validates migration input for SQL to Azure SQL Managed Instance + public partial interface IValidateMigrationInputSqlServerSqlMiTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// SAS URI of Azure Storage Account Container. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SAS URI of Azure Storage Account Container.", + SerializedName = @"sasUri", + PossibleTypes = new [] { typeof(string) })] + string BackupBlobShareSasUri { get; set; } + /// Password credential used to connect to the share location. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential used to connect to the share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The folder path for this share.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name credential to connect to the share location", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string BackupFileShareUserName { get; set; } + /// Backup Mode to specify whether to use existing backup or create new backup. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup Mode to specify whether to use existing backup or create new backup.", + SerializedName = @"backupMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? BackupMode { get; set; } + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get; set; } + /// Logins to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logins to migrate", + SerializedName = @"selectedLogins", + PossibleTypes = new [] { typeof(string) })] + string[] SelectedLogin { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for task that validates migration input for SQL to Azure SQL Managed Instance + internal partial interface IValidateMigrationInputSqlServerSqlMiTaskInputInternal + + { + /// SAS URI of Azure Storage Account Container to be used for storing backup files. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IBlobShare BackupBlobShare { get; set; } + /// SAS URI of Azure Storage Account Container. + string BackupBlobShareSasUri { get; set; } + /// Backup file share information for all selected databases. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileShare BackupFileShare { get; set; } + /// Password credential used to connect to the share location. + string BackupFileSharePassword { get; set; } + /// The folder path for this share. + string BackupFileSharePath { get; set; } + /// User name credential to connect to the share location + string BackupFileShareUserName { get; set; } + /// Backup Mode to specify whether to use existing backup or create new backup. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode? BackupMode { get; set; } + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput[] SelectedDatabase { get; set; } + /// Logins to migrate + string[] SelectedLogin { get; set; } + /// Information for connecting to source + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Information for connecting to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.json.cs new file mode 100644 index 000000000000..806988d34e14 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskInput.json.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Input for task that validates migration input for SQL to Azure SQL Managed Instance + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMigrationInputSqlServerSqlMiTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + AddIf( null != this._backupFileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupFileShare.ToJson(null,serializationMode) : null, "backupFileShare" ,container.Add ); + AddIf( null != this._backupBlobShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupBlobShare.ToJson(null,serializationMode) : null, "backupBlobShare" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + if (null != this._selectedLogin) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._selectedLogin ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("selectedLogins",__r); + } + AddIf( null != (((object)this._backupMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupMode.ToString()) : null, "backupMode" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMigrationInputSqlServerSqlMiTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_backupFileShare = If( json?.PropertyT("backupFileShare"), out var __jsonBackupFileShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.FileShare.FromJson(__jsonBackupFileShare) : BackupFileShare;} + {_backupBlobShare = If( json?.PropertyT("backupBlobShare"), out var __jsonBackupBlobShare) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.BlobShare.FromJson(__jsonBackupBlobShare) : BackupBlobShare;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlMiDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlMiDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + {_selectedLogin = If( json?.PropertyT("selectedLogins"), out var __jsonSelectedLogins) ? If( __jsonSelectedLogins as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : SelectedLogin;} + {_backupMode = If( json?.PropertyT("backupMode"), out var __jsonBackupMode) ? (string)__jsonBackupMode : (string)BackupMode;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..6fe28d21767e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.PowerShell.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations + /// + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiTaskOutputTypeConverter))] + public partial class ValidateMigrationInputSqlServerSqlMiTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMigrationInputSqlServerSqlMiTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMigrationInputSqlServerSqlMiTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMigrationInputSqlServerSqlMiTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseBackupInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo) content.GetValueForProperty("DatabaseBackupInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseBackupInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RestoreDatabaseNameError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).RestoreDatabaseNameError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("RestoreDatabaseNameError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).RestoreDatabaseNameError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupFolderError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupFolderError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("BackupFolderError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupFolderError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupShareCredentialsError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupShareCredentialsError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("BackupShareCredentialsError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupShareCredentialsError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupStorageAccountError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupStorageAccountError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("BackupStorageAccountError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupStorageAccountError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("ExistingBackupError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).ExistingBackupError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExistingBackupError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).ExistingBackupError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("DatabaseBackupInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoDatabaseName = (string) content.GetValueForProperty("DatabaseBackupInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseBackupInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("DatabaseBackupInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("DatabaseBackupInfoBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFile = (string[]) content.GetValueForProperty("DatabaseBackupInfoBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DatabaseBackupInfoPosition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoPosition = (int?) content.GetValueForProperty("DatabaseBackupInfoPosition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoPosition, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatabaseBackupInfoFamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoFamilyCount = (int?) content.GetValueForProperty("DatabaseBackupInfoFamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoFamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatabaseBackupInfoIsDamaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsDamaged = (bool?) content.GetValueForProperty("DatabaseBackupInfoIsDamaged",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsDamaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DatabaseBackupInfoIsCompressed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsCompressed = (bool?) content.GetValueForProperty("DatabaseBackupInfoIsCompressed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsCompressed, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DatabaseBackupInfoBackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("DatabaseBackupInfoBackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMigrationInputSqlServerSqlMiTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatabaseBackupInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo) content.GetValueForProperty("DatabaseBackupInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseBackupInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RestoreDatabaseNameError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).RestoreDatabaseNameError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("RestoreDatabaseNameError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).RestoreDatabaseNameError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupFolderError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupFolderError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("BackupFolderError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupFolderError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupShareCredentialsError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupShareCredentialsError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("BackupShareCredentialsError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupShareCredentialsError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("BackupStorageAccountError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupStorageAccountError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("BackupStorageAccountError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).BackupStorageAccountError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("ExistingBackupError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).ExistingBackupError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ExistingBackupError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).ExistingBackupError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("DatabaseBackupInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoDatabaseName = (string) content.GetValueForProperty("DatabaseBackupInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("DatabaseBackupInfoBackupType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType?) content.GetValueForProperty("DatabaseBackupInfoBackupType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType.CreateFrom); + } + if (content.Contains("DatabaseBackupInfoBackupFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFile = (string[]) content.GetValueForProperty("DatabaseBackupInfoBackupFile",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFile, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DatabaseBackupInfoPosition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoPosition = (int?) content.GetValueForProperty("DatabaseBackupInfoPosition",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoPosition, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatabaseBackupInfoFamilyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoFamilyCount = (int?) content.GetValueForProperty("DatabaseBackupInfoFamilyCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoFamilyCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatabaseBackupInfoIsDamaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsDamaged = (bool?) content.GetValueForProperty("DatabaseBackupInfoIsDamaged",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsDamaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DatabaseBackupInfoIsCompressed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsCompressed = (bool?) content.GetValueForProperty("DatabaseBackupInfoIsCompressed",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoIsCompressed, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DatabaseBackupInfoBackupFinishDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFinishDate = (global::System.DateTime?) content.GetValueForProperty("DatabaseBackupInfoBackupFinishDate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal)this).DatabaseBackupInfoBackupFinishDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiTaskOutputTypeConverter))] + public partial interface IValidateMigrationInputSqlServerSqlMiTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..7816d288f6d6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMigrationInputSqlServerSqlMiTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.cs new file mode 100644 index 000000000000..5c7cd67fb923 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _backupFolderError; + + /// Errors associated with the BackupFolder path + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupFolderError { get => this._backupFolderError; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _backupShareCredentialsError; + + /// Errors associated with backup share user name and password credentials + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupShareCredentialsError { get => this._backupShareCredentialsError; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _backupStorageAccountError; + + /// Errors associated with the storage account provided. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupStorageAccountError { get => this._backupStorageAccountError; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo _databaseBackupInfo; + + /// Information about backup files when existing backup mode is used. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo DatabaseBackupInfo { get => (this._databaseBackupInfo = this._databaseBackupInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseBackupInfo()); set => this._databaseBackupInfo = value; } + + /// The list of backup files for the current database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string[] DatabaseBackupInfoBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupFile; } + + /// Date and time when the backup operation finished. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public global::System.DateTime? DatabaseBackupInfoBackupFinishDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupFinishDate; } + + /// Backup Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? DatabaseBackupInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupType; } + + /// Database name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string DatabaseBackupInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).DatabaseName; } + + /// Number of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? DatabaseBackupInfoFamilyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).FamilyCount; } + + /// Whether the backup set is compressed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? DatabaseBackupInfoIsCompressed { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).IsCompressed; } + + /// + /// Database was damaged when backed up, but the backup operation was requested to continue despite errors. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? DatabaseBackupInfoIsDamaged { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).IsDamaged; } + + /// Position of current database backup in the file. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? DatabaseBackupInfoPosition { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).Position; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _existingBackupError; + + /// Errors associated with existing backup files. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExistingBackupError { get => this._existingBackupError; } + + /// Backing field for property. + private string _id; + + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for BackupFolderError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.BackupFolderError { get => this._backupFolderError; set { {_backupFolderError = value;} } } + + /// Internal Acessors for BackupShareCredentialsError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.BackupShareCredentialsError { get => this._backupShareCredentialsError; set { {_backupShareCredentialsError = value;} } } + + /// Internal Acessors for BackupStorageAccountError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.BackupStorageAccountError { get => this._backupStorageAccountError; set { {_backupStorageAccountError = value;} } } + + /// Internal Acessors for DatabaseBackupInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfo { get => (this._databaseBackupInfo = this._databaseBackupInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseBackupInfo()); set { {_databaseBackupInfo = value;} } } + + /// Internal Acessors for DatabaseBackupInfoBackupFile + string[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoBackupFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupFile = value; } + + /// Internal Acessors for DatabaseBackupInfoBackupFinishDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoBackupFinishDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupFinishDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupFinishDate = value; } + + /// Internal Acessors for DatabaseBackupInfoBackupType + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoBackupType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).BackupType = value; } + + /// Internal Acessors for DatabaseBackupInfoDatabaseName + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).DatabaseName = value; } + + /// Internal Acessors for DatabaseBackupInfoFamilyCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoFamilyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).FamilyCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).FamilyCount = value; } + + /// Internal Acessors for DatabaseBackupInfoIsCompressed + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoIsCompressed { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).IsCompressed; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).IsCompressed = value; } + + /// Internal Acessors for DatabaseBackupInfoIsDamaged + bool? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoIsDamaged { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).IsDamaged; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).IsDamaged = value; } + + /// Internal Acessors for DatabaseBackupInfoPosition + int? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.DatabaseBackupInfoPosition { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).Position; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfoInternal)DatabaseBackupInfo).Position = value; } + + /// Internal Acessors for ExistingBackupError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.ExistingBackupError { get => this._existingBackupError; set { {_existingBackupError = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for RestoreDatabaseNameError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutputInternal.RestoreDatabaseNameError { get => this._restoreDatabaseNameError; set { {_restoreDatabaseNameError = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _restoreDatabaseNameError; + + /// Errors associated with the RestoreDatabaseName + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] RestoreDatabaseNameError { get => this._restoreDatabaseNameError; } + + /// + /// Creates an new instance. + /// + public ValidateMigrationInputSqlServerSqlMiTaskOutput() + { + + } + } + /// Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations + public partial interface IValidateMigrationInputSqlServerSqlMiTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Errors associated with the BackupFolder path + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with the BackupFolder path", + SerializedName = @"backupFolderErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupFolderError { get; } + /// Errors associated with backup share user name and password credentials + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with backup share user name and password credentials", + SerializedName = @"backupShareCredentialsErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupShareCredentialsError { get; } + /// Errors associated with the storage account provided. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with the storage account provided.", + SerializedName = @"backupStorageAccountErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupStorageAccountError { get; } + /// The list of backup files for the current database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of backup files for the current database.", + SerializedName = @"backupFiles", + PossibleTypes = new [] { typeof(string) })] + string[] DatabaseBackupInfoBackupFile { get; } + /// Date and time when the backup operation finished. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date and time when the backup operation finished.", + SerializedName = @"backupFinishDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DatabaseBackupInfoBackupFinishDate { get; } + /// Backup Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Backup Type.", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? DatabaseBackupInfoBackupType { get; } + /// Database name. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database name.", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseBackupInfoDatabaseName { get; } + /// Number of files in the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of files in the backup set.", + SerializedName = @"familyCount", + PossibleTypes = new [] { typeof(int) })] + int? DatabaseBackupInfoFamilyCount { get; } + /// Whether the backup set is compressed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the backup set is compressed", + SerializedName = @"isCompressed", + PossibleTypes = new [] { typeof(bool) })] + bool? DatabaseBackupInfoIsCompressed { get; } + /// + /// Database was damaged when backed up, but the backup operation was requested to continue despite errors. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database was damaged when backed up, but the backup operation was requested to continue despite errors.", + SerializedName = @"isDamaged", + PossibleTypes = new [] { typeof(bool) })] + bool? DatabaseBackupInfoIsDamaged { get; } + /// Position of current database backup in the file. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Position of current database backup in the file.", + SerializedName = @"position", + PossibleTypes = new [] { typeof(int) })] + int? DatabaseBackupInfoPosition { get; } + /// Errors associated with existing backup files. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with existing backup files.", + SerializedName = @"existingBackupErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExistingBackupError { get; } + /// Result identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Result identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Errors associated with the RestoreDatabaseName + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with the RestoreDatabaseName", + SerializedName = @"restoreDatabaseNameErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] RestoreDatabaseNameError { get; } + + } + /// Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations + internal partial interface IValidateMigrationInputSqlServerSqlMiTaskOutputInternal + + { + /// Errors associated with the BackupFolder path + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupFolderError { get; set; } + /// Errors associated with backup share user name and password credentials + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupShareCredentialsError { get; set; } + /// Errors associated with the storage account provided. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] BackupStorageAccountError { get; set; } + /// Information about backup files when existing backup mode is used. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseBackupInfo DatabaseBackupInfo { get; set; } + /// The list of backup files for the current database. + string[] DatabaseBackupInfoBackupFile { get; set; } + /// Date and time when the backup operation finished. + global::System.DateTime? DatabaseBackupInfoBackupFinishDate { get; set; } + /// Backup Type. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType? DatabaseBackupInfoBackupType { get; set; } + /// Database name. + string DatabaseBackupInfoDatabaseName { get; set; } + /// Number of files in the backup set. + int? DatabaseBackupInfoFamilyCount { get; set; } + /// Whether the backup set is compressed + bool? DatabaseBackupInfoIsCompressed { get; set; } + /// + /// Database was damaged when backed up, but the backup operation was requested to continue despite errors. + /// + bool? DatabaseBackupInfoIsDamaged { get; set; } + /// Position of current database backup in the file. + int? DatabaseBackupInfoPosition { get; set; } + /// Errors associated with existing backup files. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ExistingBackupError { get; set; } + /// Result identifier + string Id { get; set; } + /// Name of database + string Name { get; set; } + /// Errors associated with the RestoreDatabaseName + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] RestoreDatabaseNameError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.json.cs new file mode 100644 index 000000000000..b211aecc7d50 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskOutput.json.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMigrationInputSqlServerSqlMiTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._databaseBackupInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._databaseBackupInfo.ToJson(null,serializationMode) : null, "databaseBackupInfo" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._restoreDatabaseNameError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._restoreDatabaseNameError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("restoreDatabaseNameErrors",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._backupFolderError) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __s in this._backupFolderError ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("backupFolderErrors",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._backupShareCredentialsError) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __n in this._backupShareCredentialsError ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("backupShareCredentialsErrors",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._backupStorageAccountError) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __i in this._backupStorageAccountError ) + { + AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); + } + container.Add("backupStorageAccountErrors",__h); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._existingBackupError) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __d in this._existingBackupError ) + { + AddIf(__d?.ToJson(null, serializationMode) ,__c.Add); + } + container.Add("existingBackupErrors",__c); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMigrationInputSqlServerSqlMiTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databaseBackupInfo = If( json?.PropertyT("databaseBackupInfo"), out var __jsonDatabaseBackupInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseBackupInfo.FromJson(__jsonDatabaseBackupInfo) : DatabaseBackupInfo;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_restoreDatabaseNameError = If( json?.PropertyT("restoreDatabaseNameErrors"), out var __jsonRestoreDatabaseNameErrors) ? If( __jsonRestoreDatabaseNameErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : RestoreDatabaseNameError;} + {_backupFolderError = If( json?.PropertyT("backupFolderErrors"), out var __jsonBackupFolderErrors) ? If( __jsonBackupFolderErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__p) )) ))() : null : BackupFolderError;} + {_backupShareCredentialsError = If( json?.PropertyT("backupShareCredentialsErrors"), out var __jsonBackupShareCredentialsErrors) ? If( __jsonBackupShareCredentialsErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__k) )) ))() : null : BackupShareCredentialsError;} + {_backupStorageAccountError = If( json?.PropertyT("backupStorageAccountErrors"), out var __jsonBackupStorageAccountErrors) ? If( __jsonBackupStorageAccountErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__f) )) ))() : null : BackupStorageAccountError;} + {_existingBackupError = If( json?.PropertyT("existingBackupErrors"), out var __jsonExistingBackupErrors) ? If( __jsonExistingBackupErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__a) )) ))() : null : ExistingBackupError;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..d239c308e4f7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance + /// + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiTaskPropertiesTypeConverter))] + public partial class ValidateMigrationInputSqlServerSqlMiTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMigrationInputSqlServerSqlMiTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMigrationInputSqlServerSqlMiTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMigrationInputSqlServerSqlMiTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMigrationInputSqlServerSqlMiTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + } + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance + [System.ComponentModel.TypeConverter(typeof(ValidateMigrationInputSqlServerSqlMiTaskPropertiesTypeConverter))] + public partial interface IValidateMigrationInputSqlServerSqlMiTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..387f5cc13b89 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMigrationInputSqlServerSqlMiTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMigrationInputSqlServerSqlMiTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.cs new file mode 100644 index 000000000000..342b51de3147 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput _input; + + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskInput()); set => this._input = value; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput[] _output; + + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + + /// + /// Creates an new instance. + /// + public ValidateMigrationInputSqlServerSqlMiTaskProperties() + { + + } + } + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance + public partial interface IValidateMigrationInputSqlServerSqlMiTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Task input + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task input", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Task output. This is ignored if submitted.", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput[] Output { get; } + + } + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance + internal partial interface IValidateMigrationInputSqlServerSqlMiTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Task input + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskInput Input { get; set; } + /// Task output. This is ignored if submitted. + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.json.cs new file mode 100644 index 000000000000..85b7b7664f50 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMigrationInputSqlServerSqlMiTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance + /// + public partial class ValidateMigrationInputSqlServerSqlMiTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMigrationInputSqlServerSqlMiTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMigrationInputSqlServerSqlMiTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMigrationInputSqlServerSqlMiTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateMigrationInputSqlServerSqlMiTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..509a39c00771 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Properties for the task that validates a migration between MongoDB data sources + [System.ComponentModel.TypeConverter(typeof(ValidateMongoDbTaskPropertiesTypeConverter))] + public partial class ValidateMongoDbTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateMongoDbTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateMongoDbTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateMongoDbTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgressTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateMongoDbTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgressTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + } + /// Properties for the task that validates a migration between MongoDB data sources + [System.ComponentModel.TypeConverter(typeof(ValidateMongoDbTaskPropertiesTypeConverter))] + public partial interface IValidateMongoDbTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..87cd8e9b55bd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateMongoDbTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateMongoDbTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateMongoDbTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateMongoDbTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.cs new file mode 100644 index 000000000000..04268938d881 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that validates a migration between MongoDB data sources + public partial class ValidateMongoDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings _input; + + /// Describes how a MongoDB data migration should be performed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettings()); set => this._input = value; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress[] _output; + + /// An array containing a single MongoDbMigrationProgress object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + + /// Creates an new instance. + public ValidateMongoDbTaskProperties() + { + + } + } + /// Properties for the task that validates a migration between MongoDB data sources + public partial interface IValidateMongoDbTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// Describes how a MongoDB data migration should be performed + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes how a MongoDB data migration should be performed", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings Input { get; set; } + /// An array containing a single MongoDbMigrationProgress object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An array containing a single MongoDbMigrationProgress object", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress[] Output { get; } + + } + /// Properties for the task that validates a migration between MongoDB data sources + internal partial interface IValidateMongoDbTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// Describes how a MongoDB data migration should be performed + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationSettings Input { get; set; } + /// An array containing a single MongoDbMigrationProgress object + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.json.cs new file mode 100644 index 000000000000..136eea1f2c8e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateMongoDbTaskProperties.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Properties for the task that validates a migration between MongoDB data sources + public partial class ValidateMongoDbTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateMongoDbTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateMongoDbTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateMongoDbTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMongoDbMigrationProgress) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationProgress.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MongoDbMigrationSettings.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs new file mode 100644 index 000000000000..6e3b1b190da5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(ValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter.ConvertFrom)); + } + if (content.Contains("Input")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput) content.GetValueForProperty("Input",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal)this).Input, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInputTypeConverter.ConvertFrom); + } + if (content.Contains("TaskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) content.GetValueForProperty("TaskType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).TaskType, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType.CreateFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Error, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ODataErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState.CreateFrom); + } + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) content.GetValueForProperty("ClientData",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)this).ClientData, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskPropertiesClientDataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + } + /// Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(ValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter))] + public partial interface IValidateOracleAzureDbForPostgreSqlSyncTaskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs new file mode 100644 index 000000000000..662c080170a1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 000000000000..292c180fb833 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations + /// + public partial class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(); + + /// Key value pairs of client data to attach meta data information to task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).ClientData = value ?? null /* model class */; } + + /// Array of command properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; } + + /// Array of errors. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput _input; + + /// + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get => (this._input = this._input ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInput()); set => this._input = value; } + + /// Internal Acessors for Command + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Command { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Command = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IODataError[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).Error = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State = value; } + + /// Internal Acessors for Output + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal.Output { get => this._output; set { {_output = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput[] _output; + + /// An array containing a single validation error response object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput[] Output { get => this._output; } + + /// The state of the task. This is ignored if submitted. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).State; } + + /// Task type. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal)__projectTaskProperties).TaskType = value ; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__projectTaskProperties), __projectTaskProperties); + await eventListener.AssertObjectIsValid(nameof(__projectTaskProperties), __projectTaskProperties); + } + + /// + /// Creates an new instance. + /// + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties() + { + + } + } + /// Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations + public partial interface IValidateOracleAzureDbForPostgreSqlSyncTaskProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskProperties + { + /// + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations", + SerializedName = @"input", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get; set; } + /// An array containing a single validation error response object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An array containing a single validation error response object", + SerializedName = @"output", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput[] Output { get; } + + } + /// Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations + internal partial interface IValidateOracleAzureDbForPostgreSqlSyncTaskPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesInternal + { + /// + /// Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + /// + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get; set; } + /// An array containing a single validation error response object + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput[] Output { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs new file mode 100644 index 000000000000..6379cb76a1f3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations + /// + public partial class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbForPostgreSqlSyncTaskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __projectTaskProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._output) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._output ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("output",__w); + } + } + AddIf( null != this._input ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._input.ToJson(null,serializationMode) : null, "input" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __projectTaskProperties = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTaskProperties(json); + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ValidateOracleAzureDbPostgreSqlSyncTaskOutput.FromJson(__u) )) ))() : null : Output;} + {_input = If( json?.PropertyT("input"), out var __jsonInput) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateOracleAzureDbPostgreSqlSyncTaskInput.FromJson(__jsonInput) : Input;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..848ef5880748 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.PowerShell.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations + /// + [System.ComponentModel.TypeConverter(typeof(ValidateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter))] + public partial class ValidateOracleAzureDbPostgreSqlSyncTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateOracleAzureDbPostgreSqlSyncTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateOracleAzureDbPostgreSqlSyncTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateOracleAzureDbPostgreSqlSyncTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateOracleAzureDbPostgreSqlSyncTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations + [System.ComponentModel.TypeConverter(typeof(ValidateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter))] + public partial interface IValidateOracleAzureDbPostgreSqlSyncTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..baa8b93d3ae5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateOracleAzureDbPostgreSqlSyncTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateOracleAzureDbPostgreSqlSyncTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateOracleAzureDbPostgreSqlSyncTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateOracleAzureDbPostgreSqlSyncTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.cs new file mode 100644 index 000000000000..c5b6a6e054a3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations + /// + public partial class ValidateOracleAzureDbPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutputInternal + { + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Errors associated with a selected database object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ValidateOracleAzureDbPostgreSqlSyncTaskOutput() + { + + } + } + /// Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations + public partial interface IValidateOracleAzureDbPostgreSqlSyncTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Errors associated with a selected database object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with a selected database object", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations + internal partial interface IValidateOracleAzureDbPostgreSqlSyncTaskOutputInternal + + { + /// Errors associated with a selected database object + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.json.cs new file mode 100644 index 000000000000..1b91e9872ac0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// + /// Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations + /// + public partial class ValidateOracleAzureDbPostgreSqlSyncTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateOracleAzureDbPostgreSqlSyncTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateOracleAzureDbPostgreSqlSyncTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateOracleAzureDbPostgreSqlSyncTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.PowerShell.cs new file mode 100644 index 000000000000..a329f37b1e4e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.PowerShell.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Input for task that validates migration input for SQL sync migrations + [System.ComponentModel.TypeConverter(typeof(ValidateSyncMigrationInputSqlServerTaskInputTypeConverter))] + public partial class ValidateSyncMigrationInputSqlServerTaskInput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateSyncMigrationInputSqlServerTaskInput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateSyncMigrationInputSqlServerTaskInput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateSyncMigrationInputSqlServerTaskInput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateSyncMigrationInputSqlServerTaskInput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("SourceConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetConnectionInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo) content.GetValueForProperty("TargetConnectionInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfo, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SelectedDatabase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SelectedDatabase = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[]) content.GetValueForProperty("SelectedDatabase",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SelectedDatabase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInputTypeConverter.ConvertFrom)); + } + if (content.Contains("SourceConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoType = (string) content.GetValueForProperty("SourceConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoUserName = (string) content.GetValueForProperty("SourceConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPassword = (string) content.GetValueForProperty("SourceConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource = (string) content.GetValueForProperty("SourceConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerName = (string) content.GetValueForProperty("SourceConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPort = (int?) content.GetValueForProperty("SourceConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SourceConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("SourceConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId = (string) content.GetValueForProperty("SourceConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("SourceConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("SourceConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("SourceConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("SourceConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("SourceConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("SourceConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("SourceConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).SourceConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + if (content.Contains("TargetConnectionInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoType = (string) content.GetValueForProperty("TargetConnectionInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoType, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoUserName = (string) content.GetValueForProperty("TargetConnectionInfoUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoUserName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPassword = (string) content.GetValueForProperty("TargetConnectionInfoPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPassword, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoDataSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoDataSource = (string) content.GetValueForProperty("TargetConnectionInfoDataSource",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoDataSource, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerName = (string) content.GetValueForProperty("TargetConnectionInfoServerName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerName, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPort = (int?) content.GetValueForProperty("TargetConnectionInfoPort",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TargetConnectionInfoServerVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoServerBrandVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerBrandVersion = (string) content.GetValueForProperty("TargetConnectionInfoServerBrandVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoServerBrandVersion, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoResourceId = (string) content.GetValueForProperty("TargetConnectionInfoResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType?) content.GetValueForProperty("TargetConnectionInfoAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("TargetConnectionInfoEncryptConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoEncryptConnection = (bool?) content.GetValueForProperty("TargetConnectionInfoEncryptConnection",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoEncryptConnection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoAdditionalSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAdditionalSetting = (string) content.GetValueForProperty("TargetConnectionInfoAdditionalSetting",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoAdditionalSetting, global::System.Convert.ToString); + } + if (content.Contains("TargetConnectionInfoTrustServerCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate = (bool?) content.GetValueForProperty("TargetConnectionInfoTrustServerCertificate",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoTrustServerCertificate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetConnectionInfoPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform?) content.GetValueForProperty("TargetConnectionInfoPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal)this).TargetConnectionInfoPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// Input for task that validates migration input for SQL sync migrations + [System.ComponentModel.TypeConverter(typeof(ValidateSyncMigrationInputSqlServerTaskInputTypeConverter))] + public partial interface IValidateSyncMigrationInputSqlServerTaskInput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.TypeConverter.cs new file mode 100644 index 000000000000..31589519a1df --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateSyncMigrationInputSqlServerTaskInputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateSyncMigrationInputSqlServerTaskInput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateSyncMigrationInputSqlServerTaskInput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateSyncMigrationInputSqlServerTaskInput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.cs new file mode 100644 index 000000000000..e50058fbc63e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.cs @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for task that validates migration input for SQL sync migrations + public partial class ValidateSyncMigrationInputSqlServerTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal + { + + /// Internal Acessors for SourceConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal.SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_sourceConnectionInfo = value;} } } + + /// Internal Acessors for TargetConnectionInfo + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInputInternal.TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set { {_targetConnectionInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] _selectedDatabase; + + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] SelectedDatabase { get => this._selectedDatabase; set => this._selectedDatabase = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _sourceConnectionInfo; + + /// Information for connecting to source SQL server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get => (this._sourceConnectionInfo = this._sourceConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._sourceConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? SourceConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? SourceConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)SourceConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string SourceConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)SourceConnectionInfo).UserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo _targetConnectionInfo; + + /// Information for connecting to target + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get => (this._targetConnectionInfo = this._targetConnectionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo()); set => this._targetConnectionInfo = value; } + + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoAdditionalSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).AdditionalSetting = value ?? null; } + + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Authentication = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType)""); } + + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoDataSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).DataSource = value ; } + + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoEncryptConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).EncryptConnection = value ?? default(bool); } + + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Password = value ?? null; } + + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Platform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform)""); } + + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public int? TargetConnectionInfoPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).Port = value ?? default(int); } + + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ResourceId = value ?? null; } + + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerBrandVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerBrandVersion = value ?? null; } + + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerName = value ?? null; } + + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoServerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).ServerVersion = value ?? null; } + + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public bool? TargetConnectionInfoTrustServerCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfoInternal)TargetConnectionInfo).TrustServerCertificate = value ?? default(bool); } + + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).Type = value ; } + + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Inlined)] + public string TargetConnectionInfoUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IConnectionInfoInternal)TargetConnectionInfo).UserName = value ?? null; } + + /// + /// Creates an new instance. + /// + public ValidateSyncMigrationInputSqlServerTaskInput() + { + + } + } + /// Input for task that validates migration input for SQL sync migrations + public partial interface IValidateSyncMigrationInputSqlServerTaskInput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Databases to migrate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Databases to migrate", + SerializedName = @"selectedDatabases", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string SourceConnectionInfoUserName { get; set; } + /// Additional connection settings + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional connection settings", + SerializedName = @"additionalSettings", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type to use for connection", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt the connection", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server platform type for connection", + SerializedName = @"platform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Port for Server", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the ID of an HTTP resource represented by an Azure resource provider.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server brand version", + SerializedName = @"serverBrandVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"name of the server", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerName { get; set; } + /// server version + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server version", + SerializedName = @"serverVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust the server certificate", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoType { get; set; } + /// User name + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string TargetConnectionInfoUserName { get; set; } + + } + /// Input for task that validates migration input for SQL sync migrations + internal partial interface IValidateSyncMigrationInputSqlServerTaskInputInternal + + { + /// Databases to migrate + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput[] SelectedDatabase { get; set; } + /// Information for connecting to source SQL server + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo SourceConnectionInfo { get; set; } + /// Additional connection settings + string SourceConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? SourceConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string SourceConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? SourceConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string SourceConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? SourceConnectionInfoPlatform { get; set; } + /// Port for Server + int? SourceConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string SourceConnectionInfoResourceId { get; set; } + /// server brand version + string SourceConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string SourceConnectionInfoServerName { get; set; } + /// server version + string SourceConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? SourceConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string SourceConnectionInfoType { get; set; } + /// User name + string SourceConnectionInfoUserName { get; set; } + /// Information for connecting to target + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlConnectionInfo TargetConnectionInfo { get; set; } + /// Additional connection settings + string TargetConnectionInfoAdditionalSetting { get; set; } + /// Authentication type to use for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType? TargetConnectionInfoAuthentication { get; set; } + /// Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber + string TargetConnectionInfoDataSource { get; set; } + /// Whether to encrypt the connection + bool? TargetConnectionInfoEncryptConnection { get; set; } + /// Password credential. + string TargetConnectionInfoPassword { get; set; } + /// Server platform type for connection + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform? TargetConnectionInfoPlatform { get; set; } + /// Port for Server + int? TargetConnectionInfoPort { get; set; } + /// + /// Represents the ID of an HTTP resource represented by an Azure resource provider. + /// + string TargetConnectionInfoResourceId { get; set; } + /// server brand version + string TargetConnectionInfoServerBrandVersion { get; set; } + /// name of the server + string TargetConnectionInfoServerName { get; set; } + /// server version + string TargetConnectionInfoServerVersion { get; set; } + /// Whether to trust the server certificate + bool? TargetConnectionInfoTrustServerCertificate { get; set; } + /// Type of connection info + string TargetConnectionInfoType { get; set; } + /// User name + string TargetConnectionInfoUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.json.cs new file mode 100644 index 000000000000..623995b39b9a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskInput.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Input for task that validates migration input for SQL sync migrations + public partial class ValidateSyncMigrationInputSqlServerTaskInput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskInput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateSyncMigrationInputSqlServerTaskInput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceConnectionInfo.ToJson(null,serializationMode) : null, "sourceConnectionInfo" ,container.Add ); + AddIf( null != this._targetConnectionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetConnectionInfo.ToJson(null,serializationMode) : null, "targetConnectionInfo" ,container.Add ); + if (null != this._selectedDatabase) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._selectedDatabase ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("selectedDatabases",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateSyncMigrationInputSqlServerTaskInput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceConnectionInfo = If( json?.PropertyT("sourceConnectionInfo"), out var __jsonSourceConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonSourceConnectionInfo) : SourceConnectionInfo;} + {_targetConnectionInfo = If( json?.PropertyT("targetConnectionInfo"), out var __jsonTargetConnectionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlConnectionInfo.FromJson(__jsonTargetConnectionInfo) : TargetConnectionInfo;} + {_selectedDatabase = If( json?.PropertyT("selectedDatabases"), out var __jsonSelectedDatabases) ? If( __jsonSelectedDatabases as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrateSqlServerSqlDbSyncDatabaseInput) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrateSqlServerSqlDbSyncDatabaseInput.FromJson(__u) )) ))() : null : SelectedDatabase;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.PowerShell.cs new file mode 100644 index 000000000000..8c31e4a2b0f1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.PowerShell.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Output for task that validates migration input for SQL sync migrations + [System.ComponentModel.TypeConverter(typeof(ValidateSyncMigrationInputSqlServerTaskOutputTypeConverter))] + public partial class ValidateSyncMigrationInputSqlServerTaskOutput + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidateSyncMigrationInputSqlServerTaskOutput(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidateSyncMigrationInputSqlServerTaskOutput(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidateSyncMigrationInputSqlServerTaskOutput(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidateSyncMigrationInputSqlServerTaskOutput(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("ValidationError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).ValidationError = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[]) content.GetValueForProperty("ValidationError",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal)this).ValidationError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Output for task that validates migration input for SQL sync migrations + [System.ComponentModel.TypeConverter(typeof(ValidateSyncMigrationInputSqlServerTaskOutputTypeConverter))] + public partial interface IValidateSyncMigrationInputSqlServerTaskOutput + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.TypeConverter.cs new file mode 100644 index 000000000000..fb5306a32f76 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidateSyncMigrationInputSqlServerTaskOutputTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidateSyncMigrationInputSqlServerTaskOutput.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidateSyncMigrationInputSqlServerTaskOutput.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidateSyncMigrationInputSqlServerTaskOutput.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.cs new file mode 100644 index 000000000000..43ec38ac2784 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for task that validates migration input for SQL sync migrations + public partial class ValidateSyncMigrationInputSqlServerTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal + { + + /// Backing field for property. + private string _id; + + /// Database identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ValidationError + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutputInternal.ValidationError { get => this._validationError; set { {_validationError = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] _validationError; + + /// Errors associated with a selected database object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get => this._validationError; } + + /// + /// Creates an new instance. + /// + public ValidateSyncMigrationInputSqlServerTaskOutput() + { + + } + } + /// Output for task that validates migration input for SQL sync migrations + public partial interface IValidateSyncMigrationInputSqlServerTaskOutput : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Database identifier + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Database identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Name of database + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of database", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Errors associated with a selected database object + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Errors associated with a selected database object", + SerializedName = @"validationErrors", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; } + + } + /// Output for task that validates migration input for SQL sync migrations + internal partial interface IValidateSyncMigrationInputSqlServerTaskOutputInternal + + { + /// Database identifier + string Id { get; set; } + /// Name of database + string Name { get; set; } + /// Errors associated with a selected database object + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException[] ValidationError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.json.cs new file mode 100644 index 000000000000..cfc801693385 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidateSyncMigrationInputSqlServerTaskOutput.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Output for task that validates migration input for SQL sync migrations + public partial class ValidateSyncMigrationInputSqlServerTaskOutput + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidateSyncMigrationInputSqlServerTaskOutput FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidateSyncMigrationInputSqlServerTaskOutput(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._validationError) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationError ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationErrors",__w); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateSyncMigrationInputSqlServerTaskOutput(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_validationError = If( json?.PropertyT("validationErrors"), out var __jsonValidationErrors) ? If( __jsonValidationErrors as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IReportableException) (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ReportableException.FromJson(__u) )) ))() : null : ValidationError;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.PowerShell.cs new file mode 100644 index 000000000000..e7c7207f4597 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Description about the errors happen while performing migration validation + [System.ComponentModel.TypeConverter(typeof(ValidationErrorTypeConverter))] + public partial class ValidationError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidationError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidationError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ValidationError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Text")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Text = (string) content.GetValueForProperty("Text",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Text, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidationError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Text")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Text = (string) content.GetValueForProperty("Text",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Text, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// Description about the errors happen while performing migration validation + [System.ComponentModel.TypeConverter(typeof(ValidationErrorTypeConverter))] + public partial interface IValidationError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.TypeConverter.cs new file mode 100644 index 000000000000..f4716443ad37 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ValidationErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ValidationError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ValidationError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ValidationError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.cs new file mode 100644 index 000000000000..cfd088d64e18 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description about the errors happen while performing migration validation + public partial class ValidationError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationErrorInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? _severity; + + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? Severity { get => this._severity; set => this._severity = value; } + + /// Backing field for property. + private string _text; + + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Text { get => this._text; set => this._text = value; } + + /// Creates an new instance. + public ValidationError() + { + + } + } + /// Description about the errors happen while performing migration validation + public partial interface IValidationError : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Severity of the error + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the error", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? Severity { get; set; } + /// Error Text + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Text", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string Text { get; set; } + + } + /// Description about the errors happen while performing migration validation + internal partial interface IValidationErrorInternal + + { + /// Severity of the error + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity? Severity { get; set; } + /// Error Text + string Text { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.json.cs new file mode 100644 index 000000000000..b4155e8d7156 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/ValidationError.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Description about the errors happen while performing migration validation + public partial class ValidationError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IValidationError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new ValidationError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._text)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._text.ToString()) : null, "text" ,container.Add ); + AddIf( null != (((object)this._severity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._severity.ToString()) : null, "severity" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal ValidationError(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_text = If( json?.PropertyT("text"), out var __jsonText) ? (string)__jsonText : (string)Text;} + {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (string)__jsonSeverity : (string)Severity;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.PowerShell.cs new file mode 100644 index 000000000000..19c640e9e88e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// Wait statistics gathered during query batch execution + [System.ComponentModel.TypeConverter(typeof(WaitStatisticsTypeConverter))] + public partial class WaitStatistics + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WaitStatistics(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WaitStatistics(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WaitStatistics(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("WaitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitType = (string) content.GetValueForProperty("WaitType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitType, global::System.Convert.ToString); + } + if (content.Contains("WaitTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitTimeMS = (float?) content.GetValueForProperty("WaitTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("WaitCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitCount = (long?) content.GetValueForProperty("WaitCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WaitStatistics(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("WaitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitType = (string) content.GetValueForProperty("WaitType",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitType, global::System.Convert.ToString); + } + if (content.Contains("WaitTimeMS")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitTimeMS = (float?) content.GetValueForProperty("WaitTimeMS",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitTimeMS, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("WaitCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitCount = (long?) content.GetValueForProperty("WaitCount",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal)this).WaitCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + } + /// Wait statistics gathered during query batch execution + [System.ComponentModel.TypeConverter(typeof(WaitStatisticsTypeConverter))] + public partial interface IWaitStatistics + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.TypeConverter.cs new file mode 100644 index 000000000000..a9b7491b3a61 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WaitStatisticsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WaitStatistics.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WaitStatistics.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WaitStatistics.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.cs new file mode 100644 index 000000000000..4ab4b03f4eb6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Wait statistics gathered during query batch execution + public partial class WaitStatistics : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatisticsInternal + { + + /// Backing field for property. + private long? _waitCount; + + /// Total no. of waits + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public long? WaitCount { get => this._waitCount; set => this._waitCount = value; } + + /// Backing field for property. + private float? _waitTimeMS; + + /// Total wait time in millisecond(s) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public float? WaitTimeMS { get => this._waitTimeMS; set => this._waitTimeMS = value; } + + /// Backing field for property. + private string _waitType; + + /// Type of the Wait + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string WaitType { get => this._waitType; set => this._waitType = value; } + + /// Creates an new instance. + public WaitStatistics() + { + + } + } + /// Wait statistics gathered during query batch execution + public partial interface IWaitStatistics : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Total no. of waits + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total no. of waits", + SerializedName = @"waitCount", + PossibleTypes = new [] { typeof(long) })] + long? WaitCount { get; set; } + /// Total wait time in millisecond(s) + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total wait time in millisecond(s) ", + SerializedName = @"waitTimeMs", + PossibleTypes = new [] { typeof(float) })] + float? WaitTimeMS { get; set; } + /// Type of the Wait + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the Wait", + SerializedName = @"waitType", + PossibleTypes = new [] { typeof(string) })] + string WaitType { get; set; } + + } + /// Wait statistics gathered during query batch execution + internal partial interface IWaitStatisticsInternal + + { + /// Total no. of waits + long? WaitCount { get; set; } + /// Total wait time in millisecond(s) + float? WaitTimeMS { get; set; } + /// Type of the Wait + string WaitType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.json.cs b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.json.cs new file mode 100644 index 000000000000..434ea21abb3e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/Api20220330Preview/WaitStatistics.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + /// Wait statistics gathered during query batch execution + public partial class WaitStatistics + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IWaitStatistics FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new WaitStatistics(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._waitType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._waitType.ToString()) : null, "waitType" ,container.Add ); + AddIf( null != this._waitTimeMS ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((float)this._waitTimeMS) : null, "waitTimeMs" ,container.Add ); + AddIf( null != this._waitCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._waitCount) : null, "waitCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal WaitStatistics(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_waitType = If( json?.PropertyT("waitType"), out var __jsonWaitType) ? (string)__jsonWaitType : (string)WaitType;} + {_waitTimeMS = If( json?.PropertyT("waitTimeMs"), out var __jsonWaitTimeMS) ? (float?)__jsonWaitTimeMS : WaitTimeMS;} + {_waitCount = If( json?.PropertyT("waitCount"), out var __jsonWaitCount) ? (long?)__jsonWaitCount : WaitCount;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.PowerShell.cs b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.PowerShell.cs new file mode 100644 index 000000000000..a3817b383831 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.PowerShell.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(DataMigrationIdentityTypeConverter))] + public partial class DataMigrationIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataMigrationIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("SqlDbInstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlDbInstanceName = (string) content.GetValueForProperty("SqlDbInstanceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlDbInstanceName, global::System.Convert.ToString); + } + if (content.Contains("TargetDbName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TargetDbName = (string) content.GetValueForProperty("TargetDbName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TargetDbName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ManagedInstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ManagedInstanceName = (string) content.GetValueForProperty("ManagedInstanceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ManagedInstanceName, global::System.Convert.ToString); + } + if (content.Contains("SqlVirtualMachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlVirtualMachineName = (string) content.GetValueForProperty("SqlVirtualMachineName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlVirtualMachineName, global::System.Convert.ToString); + } + if (content.Contains("SqlMigrationServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlMigrationServiceName = (string) content.GetValueForProperty("SqlMigrationServiceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlMigrationServiceName, global::System.Convert.ToString); + } + if (content.Contains("GroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).GroupName = (string) content.GetValueForProperty("GroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).GroupName, global::System.Convert.ToString); + } + if (content.Contains("ServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ServiceName = (string) content.GetValueForProperty("ServiceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ServiceName, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("TaskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TaskName = (string) content.GetValueForProperty("TaskName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TaskName, global::System.Convert.ToString); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataMigrationIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("SqlDbInstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlDbInstanceName = (string) content.GetValueForProperty("SqlDbInstanceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlDbInstanceName, global::System.Convert.ToString); + } + if (content.Contains("TargetDbName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TargetDbName = (string) content.GetValueForProperty("TargetDbName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TargetDbName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ManagedInstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ManagedInstanceName = (string) content.GetValueForProperty("ManagedInstanceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ManagedInstanceName, global::System.Convert.ToString); + } + if (content.Contains("SqlVirtualMachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlVirtualMachineName = (string) content.GetValueForProperty("SqlVirtualMachineName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlVirtualMachineName, global::System.Convert.ToString); + } + if (content.Contains("SqlMigrationServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlMigrationServiceName = (string) content.GetValueForProperty("SqlMigrationServiceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).SqlMigrationServiceName, global::System.Convert.ToString); + } + if (content.Contains("GroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).GroupName = (string) content.GetValueForProperty("GroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).GroupName, global::System.Convert.ToString); + } + if (content.Contains("ServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ServiceName = (string) content.GetValueForProperty("ServiceName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ServiceName, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ProjectName = (string) content.GetValueForProperty("ProjectName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).ProjectName, global::System.Convert.ToString); + } + if (content.Contains("TaskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TaskName = (string) content.GetValueForProperty("TaskName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).TaskName, global::System.Convert.ToString); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataMigrationIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataMigrationIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(DataMigrationIdentityTypeConverter))] + public partial interface IDataMigrationIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.TypeConverter.cs b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.TypeConverter.cs new file mode 100644 index 000000000000..c60ead64c050 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.TypeConverter.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataMigrationIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + // we allow string conversion too. + if (type == typeof(global::System.String)) + { + return true; + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + // support direct string to id type conversion. + if (type == typeof(global::System.String)) + { + return new DataMigrationIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataMigrationIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataMigrationIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataMigrationIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.cs b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.cs new file mode 100644 index 000000000000..0a6da42521e9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.cs @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class DataMigrationIdentity : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentityInternal + { + + /// Backing field for property. + private string _fileName; + + /// Name of the File + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string FileName { get => this._fileName; set => this._fileName = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _location; + + /// The Azure region of the operation + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private string _managedInstanceName; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ManagedInstanceName { get => this._managedInstanceName; set => this._managedInstanceName = value; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _sqlDbInstanceName; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SqlDbInstanceName { get => this._sqlDbInstanceName; set => this._sqlDbInstanceName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string _sqlVirtualMachineName; + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SqlVirtualMachineName { get => this._sqlVirtualMachineName; set => this._sqlVirtualMachineName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.PropertyOrigin.Owned)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// Creates an new instance. + public DataMigrationIdentity() + { + + } + } + public partial interface IDataMigrationIdentity : + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable + { + /// Name of the File + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the File", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + string FileName { get; set; } + /// Name of the resource group + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + string GroupName { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The Azure region of the operation + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure region of the operation", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"managedInstanceName", + PossibleTypes = new [] { typeof(string) })] + string ManagedInstanceName { get; set; } + /// Name of the project + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + string ProjectName { get; set; } + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// Name of the service + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + string ServiceName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlDbInstanceName", + PossibleTypes = new [] { typeof(string) })] + string SqlDbInstanceName { get; set; } + /// Name of the SQL Migration Service. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + string SqlMigrationServiceName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlVirtualMachineName", + PossibleTypes = new [] { typeof(string) })] + string SqlVirtualMachineName { get; set; } + /// Subscription ID that identifies an Azure subscription. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// The name of the target database. + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + string TargetDbName { get; set; } + /// Name of the Task + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + string TaskName { get; set; } + + } + internal partial interface IDataMigrationIdentityInternal + + { + /// Name of the File + string FileName { get; set; } + /// Name of the resource group + string GroupName { get; set; } + /// Resource identity path + string Id { get; set; } + /// The Azure region of the operation + string Location { get; set; } + + string ManagedInstanceName { get; set; } + /// Name of the project + string ProjectName { get; set; } + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + string ResourceGroupName { get; set; } + /// Name of the service + string ServiceName { get; set; } + + string SqlDbInstanceName { get; set; } + /// Name of the SQL Migration Service. + string SqlMigrationServiceName { get; set; } + + string SqlVirtualMachineName { get; set; } + /// Subscription ID that identifies an Azure subscription. + string SubscriptionId { get; set; } + /// The name of the target database. + string TargetDbName { get; set; } + /// Name of the Task + string TaskName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.json.cs b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.json.cs new file mode 100644 index 000000000000..6492cdefb3b4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Models/DataMigrationIdentity.json.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public partial class DataMigrationIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject instance to deserialize from. + internal DataMigrationIdentity(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_sqlDbInstanceName = If( json?.PropertyT("sqlDbInstanceName"), out var __jsonSqlDbInstanceName) ? (string)__jsonSqlDbInstanceName : (string)SqlDbInstanceName;} + {_targetDbName = If( json?.PropertyT("targetDbName"), out var __jsonTargetDbName) ? (string)__jsonTargetDbName : (string)TargetDbName;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_managedInstanceName = If( json?.PropertyT("managedInstanceName"), out var __jsonManagedInstanceName) ? (string)__jsonManagedInstanceName : (string)ManagedInstanceName;} + {_sqlVirtualMachineName = If( json?.PropertyT("sqlVirtualMachineName"), out var __jsonSqlVirtualMachineName) ? (string)__jsonSqlVirtualMachineName : (string)SqlVirtualMachineName;} + {_sqlMigrationServiceName = If( json?.PropertyT("sqlMigrationServiceName"), out var __jsonSqlMigrationServiceName) ? (string)__jsonSqlMigrationServiceName : (string)SqlMigrationServiceName;} + {_groupName = If( json?.PropertyT("groupName"), out var __jsonGroupName) ? (string)__jsonGroupName : (string)GroupName;} + {_serviceName = If( json?.PropertyT("serviceName"), out var __jsonServiceName) ? (string)__jsonServiceName : (string)ServiceName;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_projectName = If( json?.PropertyT("projectName"), out var __jsonProjectName) ? (string)__jsonProjectName : (string)ProjectName;} + {_taskName = If( json?.PropertyT("taskName"), out var __jsonTaskName) ? (string)__jsonTaskName : (string)TaskName;} + {_fileName = If( json?.PropertyT("fileName"), out var __jsonFileName) ? (string)__jsonFileName : (string)FileName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new DataMigrationIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._sqlDbInstanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sqlDbInstanceName.ToString()) : null, "sqlDbInstanceName" ,container.Add ); + AddIf( null != (((object)this._targetDbName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDbName.ToString()) : null, "targetDbName" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._managedInstanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._managedInstanceName.ToString()) : null, "managedInstanceName" ,container.Add ); + AddIf( null != (((object)this._sqlVirtualMachineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sqlVirtualMachineName.ToString()) : null, "sqlVirtualMachineName" ,container.Add ); + AddIf( null != (((object)this._sqlMigrationServiceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sqlMigrationServiceName.ToString()) : null, "sqlMigrationServiceName" ,container.Add ); + AddIf( null != (((object)this._groupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._groupName.ToString()) : null, "groupName" ,container.Add ); + AddIf( null != (((object)this._serviceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._serviceName.ToString()) : null, "serviceName" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != (((object)this._projectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._projectName.ToString()) : null, "projectName" ,container.Add ); + AddIf( null != (((object)this._taskName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._taskName.ToString()) : null, "taskName" ,container.Add ); + AddIf( null != (((object)this._fileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileName.ToString()) : null, "fileName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/AuthenticationType.Completer.cs b/swaggerci/datamigration/generated/api/Support/AuthenticationType.Completer.cs new file mode 100644 index 000000000000..cf693c93849a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/AuthenticationType.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of possible authentication types when connecting + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationTypeTypeConverter))] + public partial struct AuthenticationType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WindowsAuthentication".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WindowsAuthentication'", "WindowsAuthentication", global::System.Management.Automation.CompletionResultType.ParameterValue, "WindowsAuthentication"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlAuthentication".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SqlAuthentication'", "SqlAuthentication", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlAuthentication"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActiveDirectoryIntegrated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ActiveDirectoryIntegrated'", "ActiveDirectoryIntegrated", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActiveDirectoryIntegrated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActiveDirectoryPassword".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ActiveDirectoryPassword'", "ActiveDirectoryPassword", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActiveDirectoryPassword"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/AuthenticationType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/AuthenticationType.TypeConverter.cs new file mode 100644 index 000000000000..559c01d80748 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/AuthenticationType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of possible authentication types when connecting + public partial class AuthenticationTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AuthenticationType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/AuthenticationType.cs b/swaggerci/datamigration/generated/api/Support/AuthenticationType.cs new file mode 100644 index 000000000000..c764dcd2f1ab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/AuthenticationType.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of possible authentication types when connecting + public partial struct AuthenticationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType ActiveDirectoryIntegrated = @"ActiveDirectoryIntegrated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType ActiveDirectoryPassword = @"ActiveDirectoryPassword"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType SqlAuthentication = @"SqlAuthentication"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType WindowsAuthentication = @"WindowsAuthentication"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AuthenticationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AuthenticationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AuthenticationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AuthenticationType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AuthenticationType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AuthenticationType && Equals((AuthenticationType)obj); + } + + /// Returns hashCode for enum AuthenticationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AuthenticationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AuthenticationType + /// the value to convert to an instance of . + + public static implicit operator AuthenticationType(string value) + { + return new AuthenticationType(value); + } + + /// Implicit operator to convert AuthenticationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType e) + { + return e._value; + } + + /// Overriding != operator for enum AuthenticationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AuthenticationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.AuthenticationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupFileStatus.Completer.cs b/swaggerci/datamigration/generated/api/Support/BackupFileStatus.Completer.cs new file mode 100644 index 000000000000..3a399a271702 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupFileStatus.Completer.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of Status of the log backup file. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatusTypeConverter))] + public partial struct BackupFileStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Arrived".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Arrived'", "Arrived", global::System.Management.Automation.CompletionResultType.ParameterValue, "Arrived"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Queued".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Queued'", "Queued", global::System.Management.Automation.CompletionResultType.ParameterValue, "Queued"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Uploading".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Uploading'", "Uploading", global::System.Management.Automation.CompletionResultType.ParameterValue, "Uploading"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Uploaded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Uploaded'", "Uploaded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Uploaded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Restoring".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Restoring'", "Restoring", global::System.Management.Automation.CompletionResultType.ParameterValue, "Restoring"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Restored".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Restored'", "Restored", global::System.Management.Automation.CompletionResultType.ParameterValue, "Restored"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupFileStatus.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/BackupFileStatus.TypeConverter.cs new file mode 100644 index 000000000000..436426cc2fb8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupFileStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of Status of the log backup file. + public partial class BackupFileStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BackupFileStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupFileStatus.cs b/swaggerci/datamigration/generated/api/Support/BackupFileStatus.cs new file mode 100644 index 000000000000..3f79559170a2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupFileStatus.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of Status of the log backup file. + public partial struct BackupFileStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus Arrived = @"Arrived"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus Cancelled = @"Cancelled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus Queued = @"Queued"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus Restored = @"Restored"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus Restoring = @"Restoring"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus Uploaded = @"Uploaded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus Uploading = @"Uploading"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private BackupFileStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackupFileStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackupFileStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackupFileStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackupFileStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackupFileStatus && Equals((BackupFileStatus)obj); + } + + /// Returns hashCode for enum BackupFileStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackupFileStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackupFileStatus + /// the value to convert to an instance of . + + public static implicit operator BackupFileStatus(string value) + { + return new BackupFileStatus(value); + } + + /// Implicit operator to convert BackupFileStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus e) + { + return e._value; + } + + /// Overriding != operator for enum BackupFileStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackupFileStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupFileStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupMode.Completer.cs b/swaggerci/datamigration/generated/api/Support/BackupMode.Completer.cs new file mode 100644 index 000000000000..bd1797762582 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupMode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of backup modes + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupModeTypeConverter))] + public partial struct BackupMode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CreateBackup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CreateBackup'", "CreateBackup", global::System.Management.Automation.CompletionResultType.ParameterValue, "CreateBackup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ExistingBackup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ExistingBackup'", "ExistingBackup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ExistingBackup"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupMode.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/BackupMode.TypeConverter.cs new file mode 100644 index 000000000000..e44bd34b5c3c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of backup modes + public partial class BackupModeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BackupMode.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupMode.cs b/swaggerci/datamigration/generated/api/Support/BackupMode.cs new file mode 100644 index 000000000000..fd5c0025236d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupMode.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of backup modes + public partial struct BackupMode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode CreateBackup = @"CreateBackup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode ExistingBackup = @"ExistingBackup"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private BackupMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackupMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackupMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackupMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackupMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackupMode && Equals((BackupMode)obj); + } + + /// Returns hashCode for enum BackupMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackupMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackupMode + /// the value to convert to an instance of . + + public static implicit operator BackupMode(string value) + { + return new BackupMode(value); + } + + /// Implicit operator to convert BackupMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode e) + { + return e._value; + } + + /// Overriding != operator for enum BackupMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackupMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupType.Completer.cs b/swaggerci/datamigration/generated/api/Support/BackupType.Completer.cs new file mode 100644 index 000000000000..82335e6550ac --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupType.Completer.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different backup types. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupTypeTypeConverter))] + public partial struct BackupType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Database".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Database'", "Database", global::System.Management.Automation.CompletionResultType.ParameterValue, "Database"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TransactionLog".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TransactionLog'", "TransactionLog", global::System.Management.Automation.CompletionResultType.ParameterValue, "TransactionLog"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "File".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'File'", "File", global::System.Management.Automation.CompletionResultType.ParameterValue, "File"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DifferentialDatabase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DifferentialDatabase'", "DifferentialDatabase", global::System.Management.Automation.CompletionResultType.ParameterValue, "DifferentialDatabase"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DifferentialFile".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DifferentialFile'", "DifferentialFile", global::System.Management.Automation.CompletionResultType.ParameterValue, "DifferentialFile"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Partial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Partial'", "Partial", global::System.Management.Automation.CompletionResultType.ParameterValue, "Partial"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DifferentialPartial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DifferentialPartial'", "DifferentialPartial", global::System.Management.Automation.CompletionResultType.ParameterValue, "DifferentialPartial"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/BackupType.TypeConverter.cs new file mode 100644 index 000000000000..bc728f9e8097 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different backup types. + public partial class BackupTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BackupType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/BackupType.cs b/swaggerci/datamigration/generated/api/Support/BackupType.cs new file mode 100644 index 000000000000..46971755e58c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/BackupType.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different backup types. + public partial struct BackupType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType Database = @"Database"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType DifferentialDatabase = @"DifferentialDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType DifferentialFile = @"DifferentialFile"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType DifferentialPartial = @"DifferentialPartial"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType File = @"File"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType Partial = @"Partial"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType TransactionLog = @"TransactionLog"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private BackupType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackupType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackupType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackupType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackupType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackupType && Equals((BackupType)obj); + } + + /// Returns hashCode for enum BackupType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackupType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackupType + /// the value to convert to an instance of . + + public static implicit operator BackupType(string value) + { + return new BackupType(value); + } + + /// Implicit operator to convert BackupType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType e) + { + return e._value; + } + + /// Overriding != operator for enum BackupType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackupType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.BackupType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CommandState.Completer.cs b/swaggerci/datamigration/generated/api/Support/CommandState.Completer.cs new file mode 100644 index 000000000000..9574f97d4a06 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CommandState.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The state of the command. This is ignored if submitted. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandStateTypeConverter))] + public partial struct CommandState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CommandState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/CommandState.TypeConverter.cs new file mode 100644 index 000000000000..67ee688379b7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CommandState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The state of the command. This is ignored if submitted. + public partial class CommandStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CommandState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CommandState.cs b/swaggerci/datamigration/generated/api/Support/CommandState.cs new file mode 100644 index 000000000000..1f04e7986020 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CommandState.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The state of the command. This is ignored if submitted. + public partial struct CommandState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState Accepted = @"Accepted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState Running = @"Running"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private CommandState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to CommandState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CommandState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type CommandState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CommandState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CommandState && Equals((CommandState)obj); + } + + /// Returns hashCode for enum CommandState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CommandState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CommandState + /// the value to convert to an instance of . + + public static implicit operator CommandState(string value) + { + return new CommandState(value); + } + + /// Implicit operator to convert CommandState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState e) + { + return e._value; + } + + /// Overriding != operator for enum CommandState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CommandState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CommandType.Completer.cs b/swaggerci/datamigration/generated/api/Support/CommandType.Completer.cs new file mode 100644 index 000000000000..3e771dcaa2d4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CommandType.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Command type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandTypeTypeConverter))] + public partial struct CommandType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.Sync.Complete.Database".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.Sync.Complete.Database'", "Migrate.Sync.Complete.Database", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.Sync.Complete.Database"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.SqlServer.AzureDbSqlMi.Complete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.SqlServer.AzureDbSqlMi.Complete'", "Migrate.SqlServer.AzureDbSqlMi.Complete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.SqlServer.AzureDbSqlMi.Complete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "cancel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'cancel'", "cancel", global::System.Management.Automation.CompletionResultType.ParameterValue, "cancel"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "finish".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'finish'", "finish", global::System.Management.Automation.CompletionResultType.ParameterValue, "finish"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "restart".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'restart'", "restart", global::System.Management.Automation.CompletionResultType.ParameterValue, "restart"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CommandType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/CommandType.TypeConverter.cs new file mode 100644 index 000000000000..b81f4706c019 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CommandType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Command type. + public partial class CommandTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CommandType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CommandType.cs b/swaggerci/datamigration/generated/api/Support/CommandType.cs new file mode 100644 index 000000000000..a4d602266d1c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CommandType.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Command type. + public partial struct CommandType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType Cancel = @"cancel"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType Finish = @"finish"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType MigrateSqlServerAzureDbSqlMiComplete = @"Migrate.SqlServer.AzureDbSqlMi.Complete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType MigrateSyncCompleteDatabase = @"Migrate.Sync.Complete.Database"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType Restart = @"restart"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private CommandType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to CommandType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CommandType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type CommandType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CommandType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CommandType && Equals((CommandType)obj); + } + + /// Returns hashCode for enum CommandType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CommandType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CommandType + /// the value to convert to an instance of . + + public static implicit operator CommandType(string value) + { + return new CommandType(value); + } + + /// Implicit operator to convert CommandType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType e) + { + return e._value; + } + + /// Overriding != operator for enum CommandType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CommandType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CreatedByType.Completer.cs b/swaggerci/datamigration/generated/api/Support/CreatedByType.Completer.cs new file mode 100644 index 000000000000..6f44cb771dde --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CreatedByType.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Argument completer implementation for CreatedByType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByTypeTypeConverter))] + public partial struct CreatedByType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CreatedByType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/CreatedByType.TypeConverter.cs new file mode 100644 index 000000000000..b087dfadd3b0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CreatedByType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// TypeConverter implementation for CreatedByType. + public partial class CreatedByTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreatedByType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/CreatedByType.cs b/swaggerci/datamigration/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..049474999dbd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/CreatedByType.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + public partial struct CreatedByType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType Application = @"Application"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType Key = @"Key"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType User = @"User"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to CreatedByType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CreatedByType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private CreatedByType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type CreatedByType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CreatedByType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CreatedByType && Equals((CreatedByType)obj); + } + + /// Returns hashCode for enum CreatedByType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CreatedByType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CreatedByType + /// the value to convert to an instance of . + + public static implicit operator CreatedByType(string value) + { + return new CreatedByType(value); + } + + /// Implicit operator to convert CreatedByType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType e) + { + return e._value; + } + + /// Overriding != operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CreatedByType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.Completer.cs b/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.Completer.cs new file mode 100644 index 000000000000..f869e09be3b5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Result code of the data migration + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCodeTypeConverter))] + public partial struct DataMigrationResultCode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initial'", "Initial", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initial"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ObjectNotExistsInSource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ObjectNotExistsInSource'", "ObjectNotExistsInSource", global::System.Management.Automation.CompletionResultType.ParameterValue, "ObjectNotExistsInSource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ObjectNotExistsInTarget".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ObjectNotExistsInTarget'", "ObjectNotExistsInTarget", global::System.Management.Automation.CompletionResultType.ParameterValue, "ObjectNotExistsInTarget"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TargetObjectIsInaccessible".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TargetObjectIsInaccessible'", "TargetObjectIsInaccessible", global::System.Management.Automation.CompletionResultType.ParameterValue, "TargetObjectIsInaccessible"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FatalError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FatalError'", "FatalError", global::System.Management.Automation.CompletionResultType.ParameterValue, "FatalError"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.TypeConverter.cs new file mode 100644 index 000000000000..b33b09aea03c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Result code of the data migration + public partial class DataMigrationResultCodeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DataMigrationResultCode.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.cs b/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.cs new file mode 100644 index 000000000000..d8015911f570 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DataMigrationResultCode.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Result code of the data migration + public partial struct DataMigrationResultCode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode FatalError = @"FatalError"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode Initial = @"Initial"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode ObjectNotExistsInSource = @"ObjectNotExistsInSource"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode ObjectNotExistsInTarget = @"ObjectNotExistsInTarget"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode TargetObjectIsInaccessible = @"TargetObjectIsInaccessible"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataMigrationResultCode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataMigrationResultCode(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DataMigrationResultCode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataMigrationResultCode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataMigrationResultCode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DataMigrationResultCode && Equals((DataMigrationResultCode)obj); + } + + /// Returns hashCode for enum DataMigrationResultCode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataMigrationResultCode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataMigrationResultCode + /// the value to convert to an instance of . + + public static implicit operator DataMigrationResultCode(string value) + { + return new DataMigrationResultCode(value); + } + + /// Implicit operator to convert DataMigrationResultCode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode e) + { + return e._value; + } + + /// Overriding != operator for enum DataMigrationResultCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataMigrationResultCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DataMigrationResultCode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.Completer.cs b/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.Completer.cs new file mode 100644 index 000000000000..485bd4be9ddf --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.Completer.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server database compatibility levels + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevelTypeConverter))] + public partial struct DatabaseCompatLevel : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompatLevel80".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompatLevel80'", "CompatLevel80", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompatLevel80"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompatLevel90".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompatLevel90'", "CompatLevel90", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompatLevel90"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompatLevel100".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompatLevel100'", "CompatLevel100", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompatLevel100"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompatLevel110".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompatLevel110'", "CompatLevel110", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompatLevel110"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompatLevel120".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompatLevel120'", "CompatLevel120", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompatLevel120"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompatLevel130".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompatLevel130'", "CompatLevel130", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompatLevel130"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompatLevel140".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompatLevel140'", "CompatLevel140", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompatLevel140"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.TypeConverter.cs new file mode 100644 index 000000000000..71a56880d3fb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server database compatibility levels + public partial class DatabaseCompatLevelTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DatabaseCompatLevel.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.cs b/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.cs new file mode 100644 index 000000000000..d8c94e6af946 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseCompatLevel.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server database compatibility levels + public partial struct DatabaseCompatLevel : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel CompatLevel100 = @"CompatLevel100"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel CompatLevel110 = @"CompatLevel110"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel CompatLevel120 = @"CompatLevel120"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel CompatLevel130 = @"CompatLevel130"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel CompatLevel140 = @"CompatLevel140"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel CompatLevel80 = @"CompatLevel80"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel CompatLevel90 = @"CompatLevel90"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DatabaseCompatLevel + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DatabaseCompatLevel(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DatabaseCompatLevel(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DatabaseCompatLevel + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DatabaseCompatLevel (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DatabaseCompatLevel && Equals((DatabaseCompatLevel)obj); + } + + /// Returns hashCode for enum DatabaseCompatLevel + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DatabaseCompatLevel + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DatabaseCompatLevel + /// the value to convert to an instance of . + + public static implicit operator DatabaseCompatLevel(string value) + { + return new DatabaseCompatLevel(value); + } + + /// Implicit operator to convert DatabaseCompatLevel to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel e) + { + return e._value; + } + + /// Overriding != operator for enum DatabaseCompatLevel + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DatabaseCompatLevel + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseCompatLevel e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseFileType.Completer.cs b/swaggerci/datamigration/generated/api/Support/DatabaseFileType.Completer.cs new file mode 100644 index 000000000000..b588b6def699 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseFileType.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server database file types + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileTypeTypeConverter))] + public partial struct DatabaseFileType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rows".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Rows'", "Rows", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rows"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Log".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Log'", "Log", global::System.Management.Automation.CompletionResultType.ParameterValue, "Log"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Filestream".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Filestream'", "Filestream", global::System.Management.Automation.CompletionResultType.ParameterValue, "Filestream"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotSupported".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotSupported'", "NotSupported", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotSupported"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Fulltext".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Fulltext'", "Fulltext", global::System.Management.Automation.CompletionResultType.ParameterValue, "Fulltext"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseFileType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/DatabaseFileType.TypeConverter.cs new file mode 100644 index 000000000000..8aadbfc352e2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseFileType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server database file types + public partial class DatabaseFileTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DatabaseFileType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseFileType.cs b/swaggerci/datamigration/generated/api/Support/DatabaseFileType.cs new file mode 100644 index 000000000000..47b17a62fbdb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseFileType.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server database file types + public partial struct DatabaseFileType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType Filestream = @"Filestream"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType Fulltext = @"Fulltext"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType Log = @"Log"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType NotSupported = @"NotSupported"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType Rows = @"Rows"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DatabaseFileType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DatabaseFileType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DatabaseFileType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DatabaseFileType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DatabaseFileType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DatabaseFileType && Equals((DatabaseFileType)obj); + } + + /// Returns hashCode for enum DatabaseFileType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DatabaseFileType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DatabaseFileType + /// the value to convert to an instance of . + + public static implicit operator DatabaseFileType(string value) + { + return new DatabaseFileType(value); + } + + /// Implicit operator to convert DatabaseFileType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType e) + { + return e._value; + } + + /// Overriding != operator for enum DatabaseFileType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DatabaseFileType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseFileType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.Completer.cs b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.Completer.cs new file mode 100644 index 000000000000..e7a347a4dab3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of migration + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStageTypeConverter))] + public partial struct DatabaseMigrationStage : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initialize".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initialize'", "Initialize", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initialize"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Backup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Backup'", "Backup", global::System.Management.Automation.CompletionResultType.ParameterValue, "Backup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileCopy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileCopy'", "FileCopy", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileCopy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Restore".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Restore'", "Restore", global::System.Management.Automation.CompletionResultType.ParameterValue, "Restore"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.TypeConverter.cs new file mode 100644 index 000000000000..fb8610c40c25 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of migration + public partial class DatabaseMigrationStageTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DatabaseMigrationStage.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.cs b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.cs new file mode 100644 index 000000000000..8b92a4681e0f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationStage.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of migration + public partial struct DatabaseMigrationStage : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage Backup = @"Backup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage FileCopy = @"FileCopy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage Initialize = @"Initialize"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage Restore = @"Restore"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DatabaseMigrationStage + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DatabaseMigrationStage(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DatabaseMigrationStage(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DatabaseMigrationStage + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DatabaseMigrationStage (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DatabaseMigrationStage && Equals((DatabaseMigrationStage)obj); + } + + /// Returns hashCode for enum DatabaseMigrationStage + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DatabaseMigrationStage + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DatabaseMigrationStage + /// the value to convert to an instance of . + + public static implicit operator DatabaseMigrationStage(string value) + { + return new DatabaseMigrationStage(value); + } + + /// Implicit operator to convert DatabaseMigrationStage to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage e) + { + return e._value; + } + + /// Overriding != operator for enum DatabaseMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DatabaseMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStage e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.Completer.cs b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.Completer.cs new file mode 100644 index 000000000000..25af86583be2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.Completer.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Database level migration state. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationStateTypeConverter))] + public partial struct DatabaseMigrationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UNDEFINED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UNDEFINED'", "UNDEFINED", global::System.Management.Automation.CompletionResultType.ParameterValue, "UNDEFINED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "INITIAL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'INITIAL'", "INITIAL", global::System.Management.Automation.CompletionResultType.ParameterValue, "INITIAL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FULL_BACKUP_UPLOAD_START".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FULL_BACKUP_UPLOAD_START'", "FULL_BACKUP_UPLOAD_START", global::System.Management.Automation.CompletionResultType.ParameterValue, "FULL_BACKUP_UPLOAD_START"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LOG_SHIPPING_START".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LOG_SHIPPING_START'", "LOG_SHIPPING_START", global::System.Management.Automation.CompletionResultType.ParameterValue, "LOG_SHIPPING_START"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UPLOAD_LOG_FILES_START".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UPLOAD_LOG_FILES_START'", "UPLOAD_LOG_FILES_START", global::System.Management.Automation.CompletionResultType.ParameterValue, "UPLOAD_LOG_FILES_START"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CUTOVER_START".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CUTOVER_START'", "CUTOVER_START", global::System.Management.Automation.CompletionResultType.ParameterValue, "CUTOVER_START"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "POST_CUTOVER_COMPLETE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'POST_CUTOVER_COMPLETE'", "POST_CUTOVER_COMPLETE", global::System.Management.Automation.CompletionResultType.ParameterValue, "POST_CUTOVER_COMPLETE"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "COMPLETED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'COMPLETED'", "COMPLETED", global::System.Management.Automation.CompletionResultType.ParameterValue, "COMPLETED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CANCELLED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CANCELLED'", "CANCELLED", global::System.Management.Automation.CompletionResultType.ParameterValue, "CANCELLED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FAILED'", "FAILED", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILED"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.TypeConverter.cs new file mode 100644 index 000000000000..617135be8b04 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Database level migration state. + public partial class DatabaseMigrationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DatabaseMigrationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.cs b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.cs new file mode 100644 index 000000000000..210d3f866c12 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseMigrationState.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Database level migration state. + public partial struct DatabaseMigrationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState Cancelled = @"CANCELLED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState Completed = @"COMPLETED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState CutoverStart = @"CUTOVER_START"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState Failed = @"FAILED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState FullBackupUploadStart = @"FULL_BACKUP_UPLOAD_START"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState Initial = @"INITIAL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState LogShippingStart = @"LOG_SHIPPING_START"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState PostCutoverComplete = @"POST_CUTOVER_COMPLETE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState Undefined = @"UNDEFINED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState UploadLogFilesStart = @"UPLOAD_LOG_FILES_START"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DatabaseMigrationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DatabaseMigrationState(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DatabaseMigrationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DatabaseMigrationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DatabaseMigrationState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DatabaseMigrationState && Equals((DatabaseMigrationState)obj); + } + + /// Returns hashCode for enum DatabaseMigrationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DatabaseMigrationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DatabaseMigrationState + /// the value to convert to an instance of . + + public static implicit operator DatabaseMigrationState(string value) + { + return new DatabaseMigrationState(value); + } + + /// Implicit operator to convert DatabaseMigrationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState e) + { + return e._value; + } + + /// Overriding != operator for enum DatabaseMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DatabaseMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseMigrationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseState.Completer.cs b/swaggerci/datamigration/generated/api/Support/DatabaseState.Completer.cs new file mode 100644 index 000000000000..b658403b7882 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseState.Completer.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server Database states + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseStateTypeConverter))] + public partial struct DatabaseState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Online".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Online'", "Online", global::System.Management.Automation.CompletionResultType.ParameterValue, "Online"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Restoring".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Restoring'", "Restoring", global::System.Management.Automation.CompletionResultType.ParameterValue, "Restoring"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Recovering".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Recovering'", "Recovering", global::System.Management.Automation.CompletionResultType.ParameterValue, "Recovering"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RecoveryPending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RecoveryPending'", "RecoveryPending", global::System.Management.Automation.CompletionResultType.ParameterValue, "RecoveryPending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Suspect".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Suspect'", "Suspect", global::System.Management.Automation.CompletionResultType.ParameterValue, "Suspect"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Emergency".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Emergency'", "Emergency", global::System.Management.Automation.CompletionResultType.ParameterValue, "Emergency"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Offline".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Offline'", "Offline", global::System.Management.Automation.CompletionResultType.ParameterValue, "Offline"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Copying".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Copying'", "Copying", global::System.Management.Automation.CompletionResultType.ParameterValue, "Copying"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "OfflineSecondary".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OfflineSecondary'", "OfflineSecondary", global::System.Management.Automation.CompletionResultType.ParameterValue, "OfflineSecondary"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/DatabaseState.TypeConverter.cs new file mode 100644 index 000000000000..8223581c64c4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server Database states + public partial class DatabaseStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DatabaseState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/DatabaseState.cs b/swaggerci/datamigration/generated/api/Support/DatabaseState.cs new file mode 100644 index 000000000000..6cc858d0b6d0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/DatabaseState.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of SQL Server Database states + public partial struct DatabaseState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState Copying = @"Copying"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState Emergency = @"Emergency"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState OfflineSecondary = @"OfflineSecondary"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState Online = @"Online"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState Recovering = @"Recovering"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState RecoveryPending = @"RecoveryPending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState Restoring = @"Restoring"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState Suspect = @"Suspect"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DatabaseState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DatabaseState(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DatabaseState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DatabaseState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DatabaseState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DatabaseState && Equals((DatabaseState)obj); + } + + /// Returns hashCode for enum DatabaseState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DatabaseState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DatabaseState + /// the value to convert to an instance of . + + public static implicit operator DatabaseState(string value) + { + return new DatabaseState(value); + } + + /// Implicit operator to convert DatabaseState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState e) + { + return e._value; + } + + /// Overriding != operator for enum DatabaseState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DatabaseState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.DatabaseState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ErrorType.Completer.cs b/swaggerci/datamigration/generated/api/Support/ErrorType.Completer.cs new file mode 100644 index 000000000000..d61d94a1f446 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ErrorType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Error type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorTypeTypeConverter))] + public partial struct ErrorType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Default'", "Default", global::System.Management.Automation.CompletionResultType.ParameterValue, "Default"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ErrorType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ErrorType.TypeConverter.cs new file mode 100644 index 000000000000..c2acb56c9cbb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ErrorType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Error type + public partial class ErrorTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ErrorType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ErrorType.cs b/swaggerci/datamigration/generated/api/Support/ErrorType.cs new file mode 100644 index 000000000000..cac11f0baa0b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ErrorType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Error type + public partial struct ErrorType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType Default = @"Default"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType Error = @"Error"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ErrorType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ErrorType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ErrorType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ErrorType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ErrorType && Equals((ErrorType)obj); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ErrorType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum ErrorType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ErrorType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ErrorType + /// the value to convert to an instance of . + + public static implicit operator ErrorType(string value) + { + return new ErrorType(value); + } + + /// Implicit operator to convert ErrorType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType e) + { + return e._value; + } + + /// Overriding != operator for enum ErrorType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ErrorType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ErrorType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.Completer.cs b/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.Completer.cs new file mode 100644 index 000000000000..fdfcd5acd93a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.Completer.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different stage of login migration. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStageTypeConverter))] + public partial struct LoginMigrationStage : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initialize".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initialize'", "Initialize", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initialize"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LoginMigration".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LoginMigration'", "LoginMigration", global::System.Management.Automation.CompletionResultType.ParameterValue, "LoginMigration"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EstablishUserMapping".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EstablishUserMapping'", "EstablishUserMapping", global::System.Management.Automation.CompletionResultType.ParameterValue, "EstablishUserMapping"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AssignRoleMembership".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AssignRoleMembership'", "AssignRoleMembership", global::System.Management.Automation.CompletionResultType.ParameterValue, "AssignRoleMembership"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AssignRoleOwnership".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AssignRoleOwnership'", "AssignRoleOwnership", global::System.Management.Automation.CompletionResultType.ParameterValue, "AssignRoleOwnership"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EstablishServerPermissions".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EstablishServerPermissions'", "EstablishServerPermissions", global::System.Management.Automation.CompletionResultType.ParameterValue, "EstablishServerPermissions"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EstablishObjectPermissions".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EstablishObjectPermissions'", "EstablishObjectPermissions", global::System.Management.Automation.CompletionResultType.ParameterValue, "EstablishObjectPermissions"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.TypeConverter.cs new file mode 100644 index 000000000000..b814a1d55c48 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different stage of login migration. + public partial class LoginMigrationStageTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LoginMigrationStage.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.cs b/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.cs new file mode 100644 index 000000000000..5a6a18dd4d42 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/LoginMigrationStage.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different stage of login migration. + public partial struct LoginMigrationStage : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage AssignRoleMembership = @"AssignRoleMembership"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage AssignRoleOwnership = @"AssignRoleOwnership"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage EstablishObjectPermissions = @"EstablishObjectPermissions"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage EstablishServerPermissions = @"EstablishServerPermissions"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage EstablishUserMapping = @"EstablishUserMapping"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage Initialize = @"Initialize"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage LoginMigration = @"LoginMigration"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LoginMigrationStage + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LoginMigrationStage(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LoginMigrationStage + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LoginMigrationStage (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LoginMigrationStage && Equals((LoginMigrationStage)obj); + } + + /// Returns hashCode for enum LoginMigrationStage + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private LoginMigrationStage(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LoginMigrationStage + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LoginMigrationStage + /// the value to convert to an instance of . + + public static implicit operator LoginMigrationStage(string value) + { + return new LoginMigrationStage(value); + } + + /// Implicit operator to convert LoginMigrationStage to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage e) + { + return e._value; + } + + /// Overriding != operator for enum LoginMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LoginMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginMigrationStage e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/LoginType.Completer.cs b/swaggerci/datamigration/generated/api/Support/LoginType.Completer.cs new file mode 100644 index 000000000000..db47c8e79278 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/LoginType.Completer.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum mapping of SMO LoginType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginTypeTypeConverter))] + public partial struct LoginType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WindowsUser".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WindowsUser'", "WindowsUser", global::System.Management.Automation.CompletionResultType.ParameterValue, "WindowsUser"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WindowsGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WindowsGroup'", "WindowsGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "WindowsGroup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlLogin".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SqlLogin'", "SqlLogin", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlLogin"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Certificate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Certificate'", "Certificate", global::System.Management.Automation.CompletionResultType.ParameterValue, "Certificate"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AsymmetricKey".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AsymmetricKey'", "AsymmetricKey", global::System.Management.Automation.CompletionResultType.ParameterValue, "AsymmetricKey"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ExternalUser".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ExternalUser'", "ExternalUser", global::System.Management.Automation.CompletionResultType.ParameterValue, "ExternalUser"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ExternalGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ExternalGroup'", "ExternalGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ExternalGroup"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/LoginType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/LoginType.TypeConverter.cs new file mode 100644 index 000000000000..a9e1b9b1a06b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/LoginType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum mapping of SMO LoginType. + public partial class LoginTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LoginType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/LoginType.cs b/swaggerci/datamigration/generated/api/Support/LoginType.cs new file mode 100644 index 000000000000..315abec2fab7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/LoginType.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum mapping of SMO LoginType. + public partial struct LoginType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType AsymmetricKey = @"AsymmetricKey"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType Certificate = @"Certificate"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType ExternalGroup = @"ExternalGroup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType ExternalUser = @"ExternalUser"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType SqlLogin = @"SqlLogin"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType WindowsGroup = @"WindowsGroup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType WindowsUser = @"WindowsUser"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LoginType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LoginType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LoginType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LoginType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LoginType && Equals((LoginType)obj); + } + + /// Returns hashCode for enum LoginType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private LoginType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LoginType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LoginType + /// the value to convert to an instance of . + + public static implicit operator LoginType(string value) + { + return new LoginType(value); + } + + /// Implicit operator to convert LoginType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType e) + { + return e._value; + } + + /// Overriding != operator for enum LoginType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LoginType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.LoginType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MigrationState.Completer.cs b/swaggerci/datamigration/generated/api/Support/MigrationState.Completer.cs new file mode 100644 index 000000000000..f33b4ecbc313 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MigrationState.Completer.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current state of migration + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStateTypeConverter))] + public partial struct MigrationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Skipped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Skipped'", "Skipped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Skipped"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stopped'", "Stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopped"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MigrationState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MigrationState.TypeConverter.cs new file mode 100644 index 000000000000..0a5e359779de --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MigrationState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current state of migration + public partial class MigrationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MigrationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MigrationState.cs b/swaggerci/datamigration/generated/api/Support/MigrationState.cs new file mode 100644 index 000000000000..f0ba25a85ba5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MigrationState.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current state of migration + public partial struct MigrationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState Skipped = @"Skipped"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState Stopped = @"Stopped"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MigrationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MigrationState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MigrationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MigrationState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MigrationState && Equals((MigrationState)obj); + } + + /// Returns hashCode for enum MigrationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MigrationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MigrationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MigrationState + /// the value to convert to an instance of . + + public static implicit operator MigrationState(string value) + { + return new MigrationState(value); + } + + /// Implicit operator to convert MigrationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState e) + { + return e._value; + } + + /// Overriding != operator for enum MigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MigrationStatus.Completer.cs b/swaggerci/datamigration/generated/api/Support/MigrationStatus.Completer.cs new file mode 100644 index 000000000000..cd7af2ba88c6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MigrationStatus.Completer.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current status of migration + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatusTypeConverter))] + public partial struct MigrationStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Default'", "Default", global::System.Management.Automation.CompletionResultType.ParameterValue, "Default"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Connecting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Connecting'", "Connecting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Connecting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SourceAndTargetSelected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SourceAndTargetSelected'", "SourceAndTargetSelected", global::System.Management.Automation.CompletionResultType.ParameterValue, "SourceAndTargetSelected"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelectLogins".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SelectLogins'", "SelectLogins", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelectLogins"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Configured".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Configured'", "Configured", global::System.Management.Automation.CompletionResultType.ParameterValue, "Configured"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stopped'", "Stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopped"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompletedWithWarnings".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompletedWithWarnings'", "CompletedWithWarnings", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompletedWithWarnings"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MigrationStatus.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MigrationStatus.TypeConverter.cs new file mode 100644 index 000000000000..ef9f2d59ccf2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MigrationStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current status of migration + public partial class MigrationStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MigrationStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MigrationStatus.cs b/swaggerci/datamigration/generated/api/Support/MigrationStatus.cs new file mode 100644 index 000000000000..5c8f6c958923 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MigrationStatus.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current status of migration + public partial struct MigrationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus CompletedWithWarnings = @"CompletedWithWarnings"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus Configured = @"Configured"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus Connecting = @"Connecting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus Default = @"Default"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus Error = @"Error"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus Running = @"Running"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus SelectLogins = @"SelectLogins"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus SourceAndTargetSelected = @"SourceAndTargetSelected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus Stopped = @"Stopped"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MigrationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MigrationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MigrationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MigrationStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MigrationStatus && Equals((MigrationStatus)obj); + } + + /// Returns hashCode for enum MigrationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MigrationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MigrationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MigrationStatus + /// the value to convert to an instance of . + + public static implicit operator MigrationStatus(string value) + { + return new MigrationStatus(value); + } + + /// Implicit operator to convert MigrationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum MigrationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MigrationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MigrationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.Completer.cs b/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.Completer.cs new file mode 100644 index 000000000000..427590d79fe2 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of data source + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterTypeTypeConverter))] + public partial struct MongoDbClusterType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BlobContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BlobContainer'", "BlobContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "BlobContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CosmosDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CosmosDb'", "CosmosDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "CosmosDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MongoDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MongoDb'", "MongoDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "MongoDb"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.TypeConverter.cs new file mode 100644 index 000000000000..a245b4301755 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of data source + public partial class MongoDbClusterTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MongoDbClusterType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.cs b/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.cs new file mode 100644 index 000000000000..127ec437f824 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbClusterType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of data source + public partial struct MongoDbClusterType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType BlobContainer = @"BlobContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType CosmosDb = @"CosmosDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType MongoDb = @"MongoDb"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MongoDbClusterType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MongoDbClusterType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MongoDbClusterType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MongoDbClusterType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MongoDbClusterType && Equals((MongoDbClusterType)obj); + } + + /// Returns hashCode for enum MongoDbClusterType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MongoDbClusterType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MongoDbClusterType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MongoDbClusterType + /// the value to convert to an instance of . + + public static implicit operator MongoDbClusterType(string value) + { + return new MongoDbClusterType(value); + } + + /// Implicit operator to convert MongoDbClusterType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType e) + { + return e._value; + } + + /// Overriding != operator for enum MongoDbClusterType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MongoDbClusterType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbClusterType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.Completer.cs b/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.Completer.cs new file mode 100644 index 000000000000..98c509c96115 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of error or warning + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorTypeTypeConverter))] + public partial struct MongoDbErrorType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidationError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidationError'", "ValidationError", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidationError"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.TypeConverter.cs new file mode 100644 index 000000000000..6924b1c26779 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of error or warning + public partial class MongoDbErrorTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MongoDbErrorType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.cs b/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.cs new file mode 100644 index 000000000000..82aa5af470d0 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbErrorType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of error or warning + public partial struct MongoDbErrorType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType Error = @"Error"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType ValidationError = @"ValidationError"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MongoDbErrorType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MongoDbErrorType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MongoDbErrorType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MongoDbErrorType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MongoDbErrorType && Equals((MongoDbErrorType)obj); + } + + /// Returns hashCode for enum MongoDbErrorType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MongoDbErrorType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MongoDbErrorType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MongoDbErrorType + /// the value to convert to an instance of . + + public static implicit operator MongoDbErrorType(string value) + { + return new MongoDbErrorType(value); + } + + /// Implicit operator to convert MongoDbErrorType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType e) + { + return e._value; + } + + /// Overriding != operator for enum MongoDbErrorType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MongoDbErrorType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbErrorType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.Completer.cs b/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.Completer.cs new file mode 100644 index 000000000000..96f9e1860eab --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.Completer.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Argument completer implementation for MongoDbMigrationState. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationStateTypeConverter))] + public partial struct MongoDbMigrationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotStarted'", "NotStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidatingInput".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidatingInput'", "ValidatingInput", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidatingInput"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initializing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initializing'", "Initializing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initializing"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Restarting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Restarting'", "Restarting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Restarting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Copying".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Copying'", "Copying", global::System.Management.Automation.CompletionResultType.ParameterValue, "Copying"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InitialReplay".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InitialReplay'", "InitialReplay", global::System.Management.Automation.CompletionResultType.ParameterValue, "InitialReplay"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Replaying".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Replaying'", "Replaying", global::System.Management.Automation.CompletionResultType.ParameterValue, "Replaying"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Finalizing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Finalizing'", "Finalizing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Finalizing"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Complete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Complete'", "Complete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Complete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.TypeConverter.cs new file mode 100644 index 000000000000..754164adbdf7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// TypeConverter implementation for MongoDbMigrationState. + public partial class MongoDbMigrationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MongoDbMigrationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.cs b/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.cs new file mode 100644 index 000000000000..8914d0a9448b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbMigrationState.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + public partial struct MongoDbMigrationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Complete = @"Complete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Copying = @"Copying"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Finalizing = @"Finalizing"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState InitialReplay = @"InitialReplay"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Initializing = @"Initializing"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState NotStarted = @"NotStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Replaying = @"Replaying"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState Restarting = @"Restarting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState ValidatingInput = @"ValidatingInput"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MongoDbMigrationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MongoDbMigrationState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MongoDbMigrationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MongoDbMigrationState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MongoDbMigrationState && Equals((MongoDbMigrationState)obj); + } + + /// Returns hashCode for enum MongoDbMigrationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MongoDbMigrationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MongoDbMigrationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MongoDbMigrationState + /// the value to convert to an instance of . + + public static implicit operator MongoDbMigrationState(string value) + { + return new MongoDbMigrationState(value); + } + + /// Implicit operator to convert MongoDbMigrationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState e) + { + return e._value; + } + + /// Overriding != operator for enum MongoDbMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MongoDbMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbMigrationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbReplication.Completer.cs b/swaggerci/datamigration/generated/api/Support/MongoDbReplication.Completer.cs new file mode 100644 index 000000000000..2919e40d7f5e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbReplication.Completer.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Describes how changes will be replicated from the source to the target. The default is OneTime. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplicationTypeConverter))] + public partial struct MongoDbReplication : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "OneTime".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OneTime'", "OneTime", global::System.Management.Automation.CompletionResultType.ParameterValue, "OneTime"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Continuous".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Continuous'", "Continuous", global::System.Management.Automation.CompletionResultType.ParameterValue, "Continuous"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbReplication.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MongoDbReplication.TypeConverter.cs new file mode 100644 index 000000000000..4340f0350d1b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbReplication.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Describes how changes will be replicated from the source to the target. The default is OneTime. + /// + public partial class MongoDbReplicationTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MongoDbReplication.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbReplication.cs b/swaggerci/datamigration/generated/api/Support/MongoDbReplication.cs new file mode 100644 index 000000000000..9d0ea87d768f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbReplication.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Describes how changes will be replicated from the source to the target. The default is OneTime. + /// + public partial struct MongoDbReplication : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication Continuous = @"Continuous"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication OneTime = @"OneTime"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MongoDbReplication + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MongoDbReplication(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MongoDbReplication + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MongoDbReplication (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MongoDbReplication && Equals((MongoDbReplication)obj); + } + + /// Returns hashCode for enum MongoDbReplication + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MongoDbReplication(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MongoDbReplication + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MongoDbReplication + /// the value to convert to an instance of . + + public static implicit operator MongoDbReplication(string value) + { + return new MongoDbReplication(value); + } + + /// Implicit operator to convert MongoDbReplication to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication e) + { + return e._value; + } + + /// Overriding != operator for enum MongoDbReplication + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MongoDbReplication + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbReplication e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.Completer.cs b/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.Completer.cs new file mode 100644 index 000000000000..8fb1cdcf0e0e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The field ordering + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrderTypeConverter))] + public partial struct MongoDbShardKeyOrder : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Forward".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Forward'", "Forward", global::System.Management.Automation.CompletionResultType.ParameterValue, "Forward"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Reverse".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Reverse'", "Reverse", global::System.Management.Automation.CompletionResultType.ParameterValue, "Reverse"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Hashed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Hashed'", "Hashed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hashed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.TypeConverter.cs new file mode 100644 index 000000000000..c4e4dadb9595 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The field ordering + public partial class MongoDbShardKeyOrderTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MongoDbShardKeyOrder.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.cs b/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.cs new file mode 100644 index 000000000000..168298fbab0f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MongoDbShardKeyOrder.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The field ordering + public partial struct MongoDbShardKeyOrder : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder Forward = @"Forward"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder Hashed = @"Hashed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder Reverse = @"Reverse"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MongoDbShardKeyOrder + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MongoDbShardKeyOrder(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MongoDbShardKeyOrder + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MongoDbShardKeyOrder (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MongoDbShardKeyOrder && Equals((MongoDbShardKeyOrder)obj); + } + + /// Returns hashCode for enum MongoDbShardKeyOrder + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MongoDbShardKeyOrder(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MongoDbShardKeyOrder + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MongoDbShardKeyOrder + /// the value to convert to an instance of . + + public static implicit operator MongoDbShardKeyOrder(string value) + { + return new MongoDbShardKeyOrder(value); + } + + /// Implicit operator to convert MongoDbShardKeyOrder to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder e) + { + return e._value; + } + + /// Overriding != operator for enum MongoDbShardKeyOrder + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MongoDbShardKeyOrder + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MongoDbShardKeyOrder e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.Completer.cs b/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.Completer.cs new file mode 100644 index 000000000000..1049510a0589 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of possible target types when migrating from MySQL + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformTypeTypeConverter))] + public partial struct MySqlTargetPlatformType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SqlServer'", "SqlServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlServer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureDbForMySQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureDbForMySQL'", "AzureDbForMySQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDbForMySQL"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.TypeConverter.cs new file mode 100644 index 000000000000..82d9c34453b1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of possible target types when migrating from MySQL + public partial class MySqlTargetPlatformTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MySqlTargetPlatformType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.cs b/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.cs new file mode 100644 index 000000000000..f878b6d2252c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/MySqlTargetPlatformType.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of possible target types when migrating from MySQL + public partial struct MySqlTargetPlatformType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType AzureDbForMySql = @"AzureDbForMySQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType SqlServer = @"SqlServer"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MySqlTargetPlatformType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MySqlTargetPlatformType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MySqlTargetPlatformType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MySqlTargetPlatformType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MySqlTargetPlatformType && Equals((MySqlTargetPlatformType)obj); + } + + /// Returns hashCode for enum MySqlTargetPlatformType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MySqlTargetPlatformType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MySqlTargetPlatformType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MySqlTargetPlatformType + /// the value to convert to an instance of . + + public static implicit operator MySqlTargetPlatformType(string value) + { + return new MySqlTargetPlatformType(value); + } + + /// Implicit operator to convert MySqlTargetPlatformType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType e) + { + return e._value; + } + + /// Overriding != operator for enum MySqlTargetPlatformType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MySqlTargetPlatformType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.MySqlTargetPlatformType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.Completer.cs b/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.Completer.cs new file mode 100644 index 000000000000..1cf554d8c0b8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The reason why the name is not available, if nameAvailable is false + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReasonTypeConverter))] + public partial struct NameCheckFailureReason : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AlreadyExists".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AlreadyExists'", "AlreadyExists", global::System.Management.Automation.CompletionResultType.ParameterValue, "AlreadyExists"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.TypeConverter.cs new file mode 100644 index 000000000000..29ef8f18d9aa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The reason why the name is not available, if nameAvailable is false + public partial class NameCheckFailureReasonTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => NameCheckFailureReason.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.cs b/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.cs new file mode 100644 index 000000000000..cde5bbb73b62 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/NameCheckFailureReason.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The reason why the name is not available, if nameAvailable is false + public partial struct NameCheckFailureReason : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason AlreadyExists = @"AlreadyExists"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NameCheckFailureReason + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NameCheckFailureReason(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NameCheckFailureReason + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NameCheckFailureReason (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is NameCheckFailureReason && Equals((NameCheckFailureReason)obj); + } + + /// Returns hashCode for enum NameCheckFailureReason + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private NameCheckFailureReason(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NameCheckFailureReason + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NameCheckFailureReason + /// the value to convert to an instance of . + + public static implicit operator NameCheckFailureReason(string value) + { + return new NameCheckFailureReason(value); + } + + /// Implicit operator to convert NameCheckFailureReason to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason e) + { + return e._value; + } + + /// Overriding != operator for enum NameCheckFailureReason + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NameCheckFailureReason + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.NameCheckFailureReason e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ObjectType.Completer.cs b/swaggerci/datamigration/generated/api/Support/ObjectType.Completer.cs new file mode 100644 index 000000000000..7b784478f75f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ObjectType.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of type of objects + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectTypeTypeConverter))] + public partial struct ObjectType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StoredProcedures".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StoredProcedures'", "StoredProcedures", global::System.Management.Automation.CompletionResultType.ParameterValue, "StoredProcedures"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Table".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Table'", "Table", global::System.Management.Automation.CompletionResultType.ParameterValue, "Table"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "View".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'View'", "View", global::System.Management.Automation.CompletionResultType.ParameterValue, "View"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Function".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Function'", "Function", global::System.Management.Automation.CompletionResultType.ParameterValue, "Function"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ObjectType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ObjectType.TypeConverter.cs new file mode 100644 index 000000000000..9a5a217d4e17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ObjectType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of type of objects + public partial class ObjectTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ObjectType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ObjectType.cs b/swaggerci/datamigration/generated/api/Support/ObjectType.cs new file mode 100644 index 000000000000..73ca60433fb6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ObjectType.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of type of objects + public partial struct ObjectType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType Function = @"Function"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType StoredProcedures = @"StoredProcedures"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType Table = @"Table"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType User = @"User"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType View = @"View"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ObjectType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ObjectType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ObjectType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ObjectType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ObjectType && Equals((ObjectType)obj); + } + + /// Returns hashCode for enum ObjectType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ObjectType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ObjectType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ObjectType + /// the value to convert to an instance of . + + public static implicit operator ObjectType(string value) + { + return new ObjectType(value); + } + + /// Implicit operator to convert ObjectType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType e) + { + return e._value; + } + + /// Overriding != operator for enum ObjectType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ObjectType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ObjectType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/OperationOrigin.Completer.cs b/swaggerci/datamigration/generated/api/Support/OperationOrigin.Completer.cs new file mode 100644 index 000000000000..5281970bdc38 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/OperationOrigin.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Argument completer implementation for OperationOrigin. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOriginTypeConverter))] + public partial struct OperationOrigin : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "user".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'user'", "user", global::System.Management.Automation.CompletionResultType.ParameterValue, "user"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "system".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'system'", "system", global::System.Management.Automation.CompletionResultType.ParameterValue, "system"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/OperationOrigin.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/OperationOrigin.TypeConverter.cs new file mode 100644 index 000000000000..40c8862cb80a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/OperationOrigin.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// TypeConverter implementation for OperationOrigin. + public partial class OperationOriginTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => OperationOrigin.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/OperationOrigin.cs b/swaggerci/datamigration/generated/api/Support/OperationOrigin.cs new file mode 100644 index 000000000000..b01945e26621 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/OperationOrigin.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + public partial struct OperationOrigin : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin System = @"system"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin User = @"user"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OperationOrigin + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OperationOrigin(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OperationOrigin + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OperationOrigin (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is OperationOrigin && Equals((OperationOrigin)obj); + } + + /// Returns hashCode for enum OperationOrigin + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private OperationOrigin(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OperationOrigin + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OperationOrigin + /// the value to convert to an instance of . + + public static implicit operator OperationOrigin(string value) + { + return new OperationOrigin(value); + } + + /// Implicit operator to convert OperationOrigin to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin e) + { + return e._value; + } + + /// Overriding != operator for enum OperationOrigin + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OperationOrigin + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.OperationOrigin e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.Completer.cs b/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.Completer.cs new file mode 100644 index 000000000000..7cdef238f4bc --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The project's provisioning state + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningStateTypeConverter))] + public partial struct ProjectProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..d1a755c3a6d6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The project's provisioning state + public partial class ProjectProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProjectProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.cs b/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.cs new file mode 100644 index 000000000000..9480ba943f07 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectProvisioningState.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The project's provisioning state + public partial struct ProjectProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProjectProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProjectProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProjectProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProjectProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProjectProvisioningState && Equals((ProjectProvisioningState)obj); + } + + /// Returns hashCode for enum ProjectProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProjectProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProjectProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProjectProvisioningState + /// the value to convert to an instance of . + + public static implicit operator ProjectProvisioningState(string value) + { + return new ProjectProvisioningState(value); + } + + /// Implicit operator to convert ProjectProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ProjectProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProjectProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.Completer.cs b/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.Completer.cs new file mode 100644 index 000000000000..684c16a89658 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Source platform of the project + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatformTypeConverter))] + public partial struct ProjectSourcePlatform : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQL'", "SQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MySQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MySQL'", "MySQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "MySQL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PostgreSql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PostgreSql'", "PostgreSql", global::System.Management.Automation.CompletionResultType.ParameterValue, "PostgreSql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MongoDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MongoDb'", "MongoDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "MongoDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.TypeConverter.cs new file mode 100644 index 000000000000..31b594c6c7e5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Source platform of the project + public partial class ProjectSourcePlatformTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProjectSourcePlatform.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.cs b/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.cs new file mode 100644 index 000000000000..9fef5016428c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectSourcePlatform.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Source platform of the project + public partial struct ProjectSourcePlatform : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform MongoDb = @"MongoDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform MySql = @"MySQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform PostgreSql = @"PostgreSql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform Sql = @"SQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProjectSourcePlatform + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProjectSourcePlatform(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProjectSourcePlatform + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProjectSourcePlatform (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProjectSourcePlatform && Equals((ProjectSourcePlatform)obj); + } + + /// Returns hashCode for enum ProjectSourcePlatform + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProjectSourcePlatform(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProjectSourcePlatform + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProjectSourcePlatform + /// the value to convert to an instance of . + + public static implicit operator ProjectSourcePlatform(string value) + { + return new ProjectSourcePlatform(value); + } + + /// Implicit operator to convert ProjectSourcePlatform to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform e) + { + return e._value; + } + + /// Overriding != operator for enum ProjectSourcePlatform + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProjectSourcePlatform + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.Completer.cs b/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.Completer.cs new file mode 100644 index 000000000000..c500c72bfb75 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Target platform of the project + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatformTypeConverter))] + public partial struct ProjectTargetPlatform : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLDB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLDB'", "SQLDB", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLDB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLMI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLMI'", "SQLMI", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLMI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureDbForMySql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureDbForMySql'", "AzureDbForMySql", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDbForMySql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureDbForPostgreSql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureDbForPostgreSql'", "AzureDbForPostgreSql", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDbForPostgreSql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MongoDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MongoDb'", "MongoDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "MongoDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.TypeConverter.cs new file mode 100644 index 000000000000..090ed0857457 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Target platform of the project + public partial class ProjectTargetPlatformTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProjectTargetPlatform.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.cs b/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.cs new file mode 100644 index 000000000000..732981236d4d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ProjectTargetPlatform.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Target platform of the project + public partial struct ProjectTargetPlatform : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform AzureDbForMySql = @"AzureDbForMySql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform AzureDbForPostgreSql = @"AzureDbForPostgreSql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform MongoDb = @"MongoDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform Sqldb = @"SQLDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform Sqlmi = @"SQLMI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProjectTargetPlatform + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProjectTargetPlatform(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProjectTargetPlatform + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProjectTargetPlatform (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProjectTargetPlatform && Equals((ProjectTargetPlatform)obj); + } + + /// Returns hashCode for enum ProjectTargetPlatform + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProjectTargetPlatform(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProjectTargetPlatform + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProjectTargetPlatform + /// the value to convert to an instance of . + + public static implicit operator ProjectTargetPlatform(string value) + { + return new ProjectTargetPlatform(value); + } + + /// Implicit operator to convert ProjectTargetPlatform to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform e) + { + return e._value; + } + + /// Overriding != operator for enum ProjectTargetPlatform + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProjectTargetPlatform + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.Completer.cs b/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.Completer.cs new file mode 100644 index 000000000000..3849f8bf0250 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Wrapper for replicate reported migration states. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationStateTypeConverter))] + public partial struct ReplicateMigrationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UNDEFINED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UNDEFINED'", "UNDEFINED", global::System.Management.Automation.CompletionResultType.ParameterValue, "UNDEFINED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VALIDATING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VALIDATING'", "VALIDATING", global::System.Management.Automation.CompletionResultType.ParameterValue, "VALIDATING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PENDING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PENDING'", "PENDING", global::System.Management.Automation.CompletionResultType.ParameterValue, "PENDING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "COMPLETE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'COMPLETE'", "COMPLETE", global::System.Management.Automation.CompletionResultType.ParameterValue, "COMPLETE"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ACTION_REQUIRED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ACTION_REQUIRED'", "ACTION_REQUIRED", global::System.Management.Automation.CompletionResultType.ParameterValue, "ACTION_REQUIRED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FAILED'", "FAILED", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILED"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.TypeConverter.cs new file mode 100644 index 000000000000..01e0786c4a2f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Wrapper for replicate reported migration states. + public partial class ReplicateMigrationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReplicateMigrationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.cs b/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.cs new file mode 100644 index 000000000000..703605353430 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ReplicateMigrationState.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Wrapper for replicate reported migration states. + public partial struct ReplicateMigrationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState ActionRequired = @"ACTION_REQUIRED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState Complete = @"COMPLETE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState Failed = @"FAILED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState Pending = @"PENDING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState Undefined = @"UNDEFINED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState Validating = @"VALIDATING"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ReplicateMigrationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ReplicateMigrationState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ReplicateMigrationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ReplicateMigrationState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ReplicateMigrationState && Equals((ReplicateMigrationState)obj); + } + + /// Returns hashCode for enum ReplicateMigrationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ReplicateMigrationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ReplicateMigrationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ReplicateMigrationState + /// the value to convert to an instance of . + + public static implicit operator ReplicateMigrationState(string value) + { + return new ReplicateMigrationState(value); + } + + /// Implicit operator to convert ReplicateMigrationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState e) + { + return e._value; + } + + /// Overriding != operator for enum ReplicateMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ReplicateMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ReplicateMigrationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.Completer.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.Completer.cs new file mode 100644 index 000000000000..ec645ca0b29d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The scale type applicable to the SKU. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleTypeTypeConverter))] + public partial struct ResourceSkuCapacityScaleType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Automatic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Automatic'", "Automatic", global::System.Management.Automation.CompletionResultType.ParameterValue, "Automatic"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Manual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Manual'", "Manual", global::System.Management.Automation.CompletionResultType.ParameterValue, "Manual"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.TypeConverter.cs new file mode 100644 index 000000000000..0cdb940e13a5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The scale type applicable to the SKU. + public partial class ResourceSkuCapacityScaleTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceSkuCapacityScaleType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.cs new file mode 100644 index 000000000000..21c023b570f8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuCapacityScaleType.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The scale type applicable to the SKU. + public partial struct ResourceSkuCapacityScaleType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType Automatic = @"Automatic"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType Manual = @"Manual"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType None = @"None"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceSkuCapacityScaleType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceSkuCapacityScaleType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceSkuCapacityScaleType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceSkuCapacityScaleType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceSkuCapacityScaleType && Equals((ResourceSkuCapacityScaleType)obj); + } + + /// Returns hashCode for enum ResourceSkuCapacityScaleType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private ResourceSkuCapacityScaleType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceSkuCapacityScaleType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceSkuCapacityScaleType + /// the value to convert to an instance of . + + public static implicit operator ResourceSkuCapacityScaleType(string value) + { + return new ResourceSkuCapacityScaleType(value); + } + + /// Implicit operator to convert ResourceSkuCapacityScaleType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceSkuCapacityScaleType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceSkuCapacityScaleType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuCapacityScaleType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.Completer.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.Completer.cs new file mode 100644 index 000000000000..692e3e00f849 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The reason code for restriction. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCodeTypeConverter))] + public partial struct ResourceSkuRestrictionsReasonCode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "QuotaId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'QuotaId'", "QuotaId", global::System.Management.Automation.CompletionResultType.ParameterValue, "QuotaId"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotAvailableForSubscription".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotAvailableForSubscription'", "NotAvailableForSubscription", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotAvailableForSubscription"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.TypeConverter.cs new file mode 100644 index 000000000000..db19bd487d9e --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The reason code for restriction. + public partial class ResourceSkuRestrictionsReasonCodeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceSkuRestrictionsReasonCode.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.cs new file mode 100644 index 000000000000..dcf02fba3f1a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsReasonCode.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The reason code for restriction. + public partial struct ResourceSkuRestrictionsReasonCode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode NotAvailableForSubscription = @"NotAvailableForSubscription"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode QuotaId = @"QuotaId"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceSkuRestrictionsReasonCode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceSkuRestrictionsReasonCode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceSkuRestrictionsReasonCode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ResourceSkuRestrictionsReasonCode (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceSkuRestrictionsReasonCode && Equals((ResourceSkuRestrictionsReasonCode)obj); + } + + /// Returns hashCode for enum ResourceSkuRestrictionsReasonCode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private ResourceSkuRestrictionsReasonCode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceSkuRestrictionsReasonCode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceSkuRestrictionsReasonCode + /// the value to convert to an instance of . + + public static implicit operator ResourceSkuRestrictionsReasonCode(string value) + { + return new ResourceSkuRestrictionsReasonCode(value); + } + + /// Implicit operator to convert ResourceSkuRestrictionsReasonCode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceSkuRestrictionsReasonCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceSkuRestrictionsReasonCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsReasonCode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.Completer.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.Completer.cs new file mode 100644 index 000000000000..259d72714755 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of restrictions. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsTypeTypeConverter))] + public partial struct ResourceSkuRestrictionsType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "location".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'location'", "location", global::System.Management.Automation.CompletionResultType.ParameterValue, "location"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.TypeConverter.cs new file mode 100644 index 000000000000..69adb1225d23 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of restrictions. + public partial class ResourceSkuRestrictionsTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceSkuRestrictionsType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.cs b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.cs new file mode 100644 index 000000000000..24d80346c269 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceSkuRestrictionsType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The type of restrictions. + public partial struct ResourceSkuRestrictionsType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType Location = @"location"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceSkuRestrictionsType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceSkuRestrictionsType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceSkuRestrictionsType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceSkuRestrictionsType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceSkuRestrictionsType && Equals((ResourceSkuRestrictionsType)obj); + } + + /// Returns hashCode for enum ResourceSkuRestrictionsType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private ResourceSkuRestrictionsType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceSkuRestrictionsType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceSkuRestrictionsType + /// the value to convert to an instance of . + + public static implicit operator ResourceSkuRestrictionsType(string value) + { + return new ResourceSkuRestrictionsType(value); + } + + /// Implicit operator to convert ResourceSkuRestrictionsType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceSkuRestrictionsType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceSkuRestrictionsType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceSkuRestrictionsType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceType.Completer.cs b/swaggerci/datamigration/generated/api/Support/ResourceType.Completer.cs new file mode 100644 index 000000000000..dc5a550aa801 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Argument completer implementation for ResourceType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceTypeTypeConverter))] + public partial struct ResourceType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlMi".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SqlMi'", "SqlMi", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlMi"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlVm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SqlVm'", "SqlVm", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlVm"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SqlDb'", "SqlDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlDb"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ResourceType.TypeConverter.cs new file mode 100644 index 000000000000..b4c84d6db897 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// TypeConverter implementation for ResourceType. + public partial class ResourceTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ResourceType.cs b/swaggerci/datamigration/generated/api/Support/ResourceType.cs new file mode 100644 index 000000000000..c3e8be94c6f9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ResourceType.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + public partial struct ResourceType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType SqlDb = @"SqlDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType SqlMi = @"SqlMi"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType SqlVM = @"SqlVm"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceType && Equals((ResourceType)obj); + } + + /// Returns hashCode for enum ResourceType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ResourceType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceType + /// the value to convert to an instance of . + + public static implicit operator ResourceType(string value) + { + return new ResourceType(value); + } + + /// Implicit operator to convert ResourceType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ScenarioSource.Completer.cs b/swaggerci/datamigration/generated/api/Support/ScenarioSource.Completer.cs new file mode 100644 index 000000000000..4c1f80dcdf7f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ScenarioSource.Completer.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of source type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSourceTypeConverter))] + public partial struct ScenarioSource : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Access".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Access'", "Access", global::System.Management.Automation.CompletionResultType.ParameterValue, "Access"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DB2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DB2'", "DB2", global::System.Management.Automation.CompletionResultType.ParameterValue, "DB2"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MySQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MySQL'", "MySQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "MySQL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Oracle".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Oracle'", "Oracle", global::System.Management.Automation.CompletionResultType.ParameterValue, "Oracle"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQL'", "SQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Sybase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Sybase'", "Sybase", global::System.Management.Automation.CompletionResultType.ParameterValue, "Sybase"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PostgreSQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PostgreSQL'", "PostgreSQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "PostgreSQL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MongoDB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MongoDB'", "MongoDB", global::System.Management.Automation.CompletionResultType.ParameterValue, "MongoDB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLRDS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLRDS'", "SQLRDS", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLRDS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MySQLRDS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MySQLRDS'", "MySQLRDS", global::System.Management.Automation.CompletionResultType.ParameterValue, "MySQLRDS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PostgreSQLRDS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PostgreSQLRDS'", "PostgreSQLRDS", global::System.Management.Automation.CompletionResultType.ParameterValue, "PostgreSQLRDS"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ScenarioSource.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ScenarioSource.TypeConverter.cs new file mode 100644 index 000000000000..8a9d3e4a66bb --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ScenarioSource.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of source type + public partial class ScenarioSourceTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ScenarioSource.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ScenarioSource.cs b/swaggerci/datamigration/generated/api/Support/ScenarioSource.cs new file mode 100644 index 000000000000..357222bbdfe8 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ScenarioSource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of source type + public partial struct ScenarioSource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource Access = @"Access"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource Db2 = @"DB2"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource MongoDb = @"MongoDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource MySql = @"MySQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource MySqlrds = @"MySQLRDS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource Oracle = @"Oracle"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource PostgreSql = @"PostgreSQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource PostgreSqlrds = @"PostgreSQLRDS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource Sql = @"SQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource Sqlrds = @"SQLRDS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource Sybase = @"Sybase"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ScenarioSource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ScenarioSource(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ScenarioSource + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ScenarioSource (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ScenarioSource && Equals((ScenarioSource)obj); + } + + /// Returns hashCode for enum ScenarioSource + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ScenarioSource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ScenarioSource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ScenarioSource + /// the value to convert to an instance of . + + public static implicit operator ScenarioSource(string value) + { + return new ScenarioSource(value); + } + + /// Implicit operator to convert ScenarioSource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource e) + { + return e._value; + } + + /// Overriding != operator for enum ScenarioSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ScenarioSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioSource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ScenarioTarget.Completer.cs b/swaggerci/datamigration/generated/api/Support/ScenarioTarget.Completer.cs new file mode 100644 index 000000000000..ac9a0fa18cd5 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ScenarioTarget.Completer.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of target type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTargetTypeConverter))] + public partial struct ScenarioTarget : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLServer'", "SQLServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLServer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLDB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLDB'", "SQLDB", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLDB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLDW".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLDW'", "SQLDW", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLDW"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLMI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLMI'", "SQLMI", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLMI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureDBForMySql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureDBForMySql'", "AzureDBForMySql", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDBForMySql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureDBForPostgresSQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureDBForPostgresSQL'", "AzureDBForPostgresSQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDBForPostgresSQL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MongoDB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MongoDB'", "MongoDB", global::System.Management.Automation.CompletionResultType.ParameterValue, "MongoDB"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ScenarioTarget.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ScenarioTarget.TypeConverter.cs new file mode 100644 index 000000000000..44d8b8ce6677 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ScenarioTarget.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of target type + public partial class ScenarioTargetTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ScenarioTarget.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ScenarioTarget.cs b/swaggerci/datamigration/generated/api/Support/ScenarioTarget.cs new file mode 100644 index 000000000000..050d4faffa1f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ScenarioTarget.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of target type + public partial struct ScenarioTarget : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget AzureDbForMySql = @"AzureDBForMySql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget AzureDbForPostgresSql = @"AzureDBForPostgresSQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget MongoDb = @"MongoDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget SqlServer = @"SQLServer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget Sqldb = @"SQLDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget Sqldw = @"SQLDW"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget Sqlmi = @"SQLMI"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ScenarioTarget + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ScenarioTarget(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ScenarioTarget + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ScenarioTarget (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ScenarioTarget && Equals((ScenarioTarget)obj); + } + + /// Returns hashCode for enum ScenarioTarget + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ScenarioTarget(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ScenarioTarget + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ScenarioTarget + /// the value to convert to an instance of . + + public static implicit operator ScenarioTarget(string value) + { + return new ScenarioTarget(value); + } + + /// Implicit operator to convert ScenarioTarget to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget e) + { + return e._value; + } + + /// Overriding != operator for enum ScenarioTarget + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ScenarioTarget + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ScenarioTarget e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.Completer.cs b/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.Completer.cs new file mode 100644 index 000000000000..429a7b5e54f7 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Option for how schema is extracted and applied to target + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOptionTypeConverter))] + public partial struct SchemaMigrationOption : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ExtractFromSource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ExtractFromSource'", "ExtractFromSource", global::System.Management.Automation.CompletionResultType.ParameterValue, "ExtractFromSource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UseStorageFile".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UseStorageFile'", "UseStorageFile", global::System.Management.Automation.CompletionResultType.ParameterValue, "UseStorageFile"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.TypeConverter.cs new file mode 100644 index 000000000000..998505cfae5f --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Option for how schema is extracted and applied to target + public partial class SchemaMigrationOptionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SchemaMigrationOption.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.cs b/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.cs new file mode 100644 index 000000000000..420bf953db67 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SchemaMigrationOption.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Option for how schema is extracted and applied to target + public partial struct SchemaMigrationOption : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption ExtractFromSource = @"ExtractFromSource"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption UseStorageFile = @"UseStorageFile"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SchemaMigrationOption + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SchemaMigrationOption(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SchemaMigrationOption + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SchemaMigrationOption (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SchemaMigrationOption && Equals((SchemaMigrationOption)obj); + } + + /// Returns hashCode for enum SchemaMigrationOption + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SchemaMigrationOption(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SchemaMigrationOption + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SchemaMigrationOption + /// the value to convert to an instance of . + + public static implicit operator SchemaMigrationOption(string value) + { + return new SchemaMigrationOption(value); + } + + /// Implicit operator to convert SchemaMigrationOption to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption e) + { + return e._value; + } + + /// Overriding != operator for enum SchemaMigrationOption + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SchemaMigrationOption + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationOption e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.Completer.cs b/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.Completer.cs new file mode 100644 index 000000000000..959007ef1917 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.Completer.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of schema migration + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStageTypeConverter))] + public partial struct SchemaMigrationStage : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotStarted'", "NotStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidatingInputs".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidatingInputs'", "ValidatingInputs", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidatingInputs"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CollectingObjects".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CollectingObjects'", "CollectingObjects", global::System.Management.Automation.CompletionResultType.ParameterValue, "CollectingObjects"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DownloadingScript".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadingScript'", "DownloadingScript", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadingScript"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GeneratingScript".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GeneratingScript'", "GeneratingScript", global::System.Management.Automation.CompletionResultType.ParameterValue, "GeneratingScript"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UploadingScript".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UploadingScript'", "UploadingScript", global::System.Management.Automation.CompletionResultType.ParameterValue, "UploadingScript"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DeployingSchema".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DeployingSchema'", "DeployingSchema", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeployingSchema"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompletedWithWarnings".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompletedWithWarnings'", "CompletedWithWarnings", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompletedWithWarnings"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.TypeConverter.cs new file mode 100644 index 000000000000..fe3e25c14d7c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of schema migration + public partial class SchemaMigrationStageTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SchemaMigrationStage.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.cs b/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.cs new file mode 100644 index 000000000000..7251fd4bbd12 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SchemaMigrationStage.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of schema migration + public partial struct SchemaMigrationStage : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage CollectingObjects = @"CollectingObjects"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage CompletedWithWarnings = @"CompletedWithWarnings"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage DeployingSchema = @"DeployingSchema"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage DownloadingScript = @"DownloadingScript"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage GeneratingScript = @"GeneratingScript"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage NotStarted = @"NotStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage UploadingScript = @"UploadingScript"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage ValidatingInputs = @"ValidatingInputs"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SchemaMigrationStage + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SchemaMigrationStage(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SchemaMigrationStage + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SchemaMigrationStage (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SchemaMigrationStage && Equals((SchemaMigrationStage)obj); + } + + /// Returns hashCode for enum SchemaMigrationStage + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SchemaMigrationStage(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SchemaMigrationStage + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SchemaMigrationStage + /// the value to convert to an instance of . + + public static implicit operator SchemaMigrationStage(string value) + { + return new SchemaMigrationStage(value); + } + + /// Implicit operator to convert SchemaMigrationStage to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage e) + { + return e._value; + } + + /// Overriding != operator for enum SchemaMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SchemaMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SchemaMigrationStage e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.Completer.cs b/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.Completer.cs new file mode 100644 index 000000000000..0fba155c7a6a --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.Completer.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Permission group for validations. These groups will run a set of permissions for validating user activity. Select the + /// permission group for the activity that you are performing. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroupTypeConverter))] + public partial struct ServerLevelPermissionsGroup : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Default'", "Default", global::System.Management.Automation.CompletionResultType.ParameterValue, "Default"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MigrationFromSqlServerToAzureDB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MigrationFromSqlServerToAzureDB'", "MigrationFromSqlServerToAzureDB", global::System.Management.Automation.CompletionResultType.ParameterValue, "MigrationFromSqlServerToAzureDB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MigrationFromSqlServerToAzureMI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MigrationFromSqlServerToAzureMI'", "MigrationFromSqlServerToAzureMI", global::System.Management.Automation.CompletionResultType.ParameterValue, "MigrationFromSqlServerToAzureMI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MigrationFromMySQLToAzureDBForMySQL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MigrationFromMySQLToAzureDBForMySQL'", "MigrationFromMySQLToAzureDBForMySQL", global::System.Management.Automation.CompletionResultType.ParameterValue, "MigrationFromMySQLToAzureDBForMySQL"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MigrationFromSqlServerToAzureVM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MigrationFromSqlServerToAzureVM'", "MigrationFromSqlServerToAzureVM", global::System.Management.Automation.CompletionResultType.ParameterValue, "MigrationFromSqlServerToAzureVM"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.TypeConverter.cs new file mode 100644 index 000000000000..b3f07e0371fe --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Permission group for validations. These groups will run a set of permissions for validating user activity. Select the + /// permission group for the activity that you are performing. + /// + public partial class ServerLevelPermissionsGroupTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ServerLevelPermissionsGroup.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.cs b/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.cs new file mode 100644 index 000000000000..00e3aa55fd97 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServerLevelPermissionsGroup.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Permission group for validations. These groups will run a set of permissions for validating user activity. Select the + /// permission group for the activity that you are performing. + /// + public partial struct ServerLevelPermissionsGroup : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup Default = @"Default"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup MigrationFromMySqlToAzureDbforMySql = @"MigrationFromMySQLToAzureDBForMySQL"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup MigrationFromSqlServerToAzureDb = @"MigrationFromSqlServerToAzureDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup MigrationFromSqlServerToAzureMi = @"MigrationFromSqlServerToAzureMI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup MigrationFromSqlServerToAzureVM = @"MigrationFromSqlServerToAzureVM"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ServerLevelPermissionsGroup + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ServerLevelPermissionsGroup(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ServerLevelPermissionsGroup + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ServerLevelPermissionsGroup (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ServerLevelPermissionsGroup && Equals((ServerLevelPermissionsGroup)obj); + } + + /// Returns hashCode for enum ServerLevelPermissionsGroup + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private ServerLevelPermissionsGroup(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ServerLevelPermissionsGroup + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ServerLevelPermissionsGroup + /// the value to convert to an instance of . + + public static implicit operator ServerLevelPermissionsGroup(string value) + { + return new ServerLevelPermissionsGroup(value); + } + + /// Implicit operator to convert ServerLevelPermissionsGroup to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup e) + { + return e._value; + } + + /// Overriding != operator for enum ServerLevelPermissionsGroup + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ServerLevelPermissionsGroup + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServerLevelPermissionsGroup e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.Completer.cs b/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.Completer.cs new file mode 100644 index 000000000000..531afafe2984 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.Completer.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The resource's provisioning state + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningStateTypeConverter))] + public partial struct ServiceProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deploying".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deploying'", "Deploying", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deploying"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stopped'", "Stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopped"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Stopping".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stopping'", "Stopping", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopping"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Starting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Starting'", "Starting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Starting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FailedToStart".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FailedToStart'", "FailedToStart", global::System.Management.Automation.CompletionResultType.ParameterValue, "FailedToStart"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FailedToStop".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FailedToStop'", "FailedToStop", global::System.Management.Automation.CompletionResultType.ParameterValue, "FailedToStop"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..84ff96a19bf9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The resource's provisioning state + public partial class ServiceProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ServiceProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.cs b/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.cs new file mode 100644 index 000000000000..6998fc401c98 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServiceProvisioningState.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The resource's provisioning state + public partial struct ServiceProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Accepted = @"Accepted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Deploying = @"Deploying"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState FailedToStart = @"FailedToStart"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState FailedToStop = @"FailedToStop"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Starting = @"Starting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Stopped = @"Stopped"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Stopping = @"Stopping"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ServiceProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ServiceProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ServiceProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ServiceProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ServiceProvisioningState && Equals((ServiceProvisioningState)obj); + } + + /// Returns hashCode for enum ServiceProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ServiceProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ServiceProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ServiceProvisioningState + /// the value to convert to an instance of . + + public static implicit operator ServiceProvisioningState(string value) + { + return new ServiceProvisioningState(value); + } + + /// Implicit operator to convert ServiceProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ServiceProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ServiceProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServiceScalability.Completer.cs b/swaggerci/datamigration/generated/api/Support/ServiceScalability.Completer.cs new file mode 100644 index 000000000000..968bba196857 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServiceScalability.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The scalability approach + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalabilityTypeConverter))] + public partial struct ServiceScalability : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "none".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'none'", "none", global::System.Management.Automation.CompletionResultType.ParameterValue, "none"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "manual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'manual'", "manual", global::System.Management.Automation.CompletionResultType.ParameterValue, "manual"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "automatic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'automatic'", "automatic", global::System.Management.Automation.CompletionResultType.ParameterValue, "automatic"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServiceScalability.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ServiceScalability.TypeConverter.cs new file mode 100644 index 000000000000..d78d99cc8a60 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServiceScalability.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The scalability approach + public partial class ServiceScalabilityTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ServiceScalability.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ServiceScalability.cs b/swaggerci/datamigration/generated/api/Support/ServiceScalability.cs new file mode 100644 index 000000000000..a0a228a907f4 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ServiceScalability.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The scalability approach + public partial struct ServiceScalability : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability Automatic = @"automatic"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability Manual = @"manual"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability None = @"none"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ServiceScalability + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ServiceScalability(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ServiceScalability + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ServiceScalability (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ServiceScalability && Equals((ServiceScalability)obj); + } + + /// Returns hashCode for enum ServiceScalability + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ServiceScalability(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ServiceScalability + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ServiceScalability + /// the value to convert to an instance of . + + public static implicit operator ServiceScalability(string value) + { + return new ServiceScalability(value); + } + + /// Implicit operator to convert ServiceScalability to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability e) + { + return e._value; + } + + /// Overriding != operator for enum ServiceScalability + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ServiceScalability + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ServiceScalability e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/Severity.Completer.cs b/swaggerci/datamigration/generated/api/Support/Severity.Completer.cs new file mode 100644 index 000000000000..7699289a90fe --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/Severity.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Severity of the validation error + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SeverityTypeConverter))] + public partial struct Severity : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Message".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Message'", "Message", global::System.Management.Automation.CompletionResultType.ParameterValue, "Message"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/Severity.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/Severity.TypeConverter.cs new file mode 100644 index 000000000000..ff02f29ff050 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/Severity.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Severity of the validation error + public partial class SeverityTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Severity.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/Severity.cs b/swaggerci/datamigration/generated/api/Support/Severity.cs new file mode 100644 index 000000000000..401dd2f539cd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/Severity.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Severity of the validation error + public partial struct Severity : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity Error = @"Error"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity Message = @"Message"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Severity + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Severity(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Severity + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Severity (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Severity && Equals((Severity)obj); + } + + /// Returns hashCode for enum Severity + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private Severity(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Severity + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Severity + /// the value to convert to an instance of . + + public static implicit operator Severity(string value) + { + return new Severity(value); + } + + /// Implicit operator to convert Severity to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity e) + { + return e._value; + } + + /// Overriding != operator for enum Severity + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Severity + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.Severity e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.Completer.cs b/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.Completer.cs new file mode 100644 index 000000000000..11ae210c3b2b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of source platform types + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatformTypeConverter))] + public partial struct SqlSourcePlatform : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlOnPrem".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SqlOnPrem'", "SqlOnPrem", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlOnPrem"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.TypeConverter.cs new file mode 100644 index 000000000000..722d315d1ab3 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of source platform types + public partial class SqlSourcePlatformTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SqlSourcePlatform.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.cs b/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.cs new file mode 100644 index 000000000000..ab1f40c77278 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SqlSourcePlatform.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of source platform types + public partial struct SqlSourcePlatform : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform SqlOnPrem = @"SqlOnPrem"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SqlSourcePlatform + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SqlSourcePlatform(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SqlSourcePlatform + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SqlSourcePlatform (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SqlSourcePlatform && Equals((SqlSourcePlatform)obj); + } + + /// Returns hashCode for enum SqlSourcePlatform + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SqlSourcePlatform(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SqlSourcePlatform + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SqlSourcePlatform + /// the value to convert to an instance of . + + public static implicit operator SqlSourcePlatform(string value) + { + return new SqlSourcePlatform(value); + } + + /// Implicit operator to convert SqlSourcePlatform to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform e) + { + return e._value; + } + + /// Overriding != operator for enum SqlSourcePlatform + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SqlSourcePlatform + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SqlSourcePlatform e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.Completer.cs b/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.Completer.cs new file mode 100644 index 000000000000..d311f78e6afd --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// The overwrite option for SSIS object migration, only ignore and overwrite are supported in DMS now and future may add + /// Reuse option for container object + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOptionTypeConverter))] + public partial struct SsisMigrationOverwriteOption : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Ignore".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Ignore'", "Ignore", global::System.Management.Automation.CompletionResultType.ParameterValue, "Ignore"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Overwrite".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Overwrite'", "Overwrite", global::System.Management.Automation.CompletionResultType.ParameterValue, "Overwrite"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.TypeConverter.cs new file mode 100644 index 000000000000..298b0fe0bdaa --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// The overwrite option for SSIS object migration, only ignore and overwrite are supported in DMS now and future may add + /// Reuse option for container object + /// + public partial class SsisMigrationOverwriteOptionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SsisMigrationOverwriteOption.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.cs b/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.cs new file mode 100644 index 000000000000..94ecc6193105 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisMigrationOverwriteOption.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// The overwrite option for SSIS object migration, only ignore and overwrite are supported in DMS now and future may add + /// Reuse option for container object + /// + public partial struct SsisMigrationOverwriteOption : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption Ignore = @"Ignore"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption Overwrite = @"Overwrite"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to SsisMigrationOverwriteOption + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SsisMigrationOverwriteOption(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SsisMigrationOverwriteOption + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SsisMigrationOverwriteOption (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SsisMigrationOverwriteOption && Equals((SsisMigrationOverwriteOption)obj); + } + + /// Returns hashCode for enum SsisMigrationOverwriteOption + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private SsisMigrationOverwriteOption(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SsisMigrationOverwriteOption + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SsisMigrationOverwriteOption + /// the value to convert to an instance of . + + public static implicit operator SsisMigrationOverwriteOption(string value) + { + return new SsisMigrationOverwriteOption(value); + } + + /// Implicit operator to convert SsisMigrationOverwriteOption to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption e) + { + return e._value; + } + + /// Overriding != operator for enum SsisMigrationOverwriteOption + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SsisMigrationOverwriteOption + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationOverwriteOption e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.Completer.cs b/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.Completer.cs new file mode 100644 index 000000000000..cc85bb6c3b59 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of SSIS migration + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStageTypeConverter))] + public partial struct SsisMigrationStage : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initialize".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initialize'", "Initialize", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initialize"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.TypeConverter.cs new file mode 100644 index 000000000000..51dd075d2a35 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of SSIS migration + public partial class SsisMigrationStageTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SsisMigrationStage.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.cs b/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.cs new file mode 100644 index 000000000000..a395555c7244 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisMigrationStage.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current stage of SSIS migration + public partial struct SsisMigrationStage : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage Initialize = @"Initialize"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SsisMigrationStage + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SsisMigrationStage(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SsisMigrationStage + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SsisMigrationStage (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SsisMigrationStage && Equals((SsisMigrationStage)obj); + } + + /// Returns hashCode for enum SsisMigrationStage + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SsisMigrationStage(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SsisMigrationStage + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SsisMigrationStage + /// the value to convert to an instance of . + + public static implicit operator SsisMigrationStage(string value) + { + return new SsisMigrationStage(value); + } + + /// Implicit operator to convert SsisMigrationStage to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage e) + { + return e._value; + } + + /// Overriding != operator for enum SsisMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SsisMigrationStage + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisMigrationStage e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisStoreType.Completer.cs b/swaggerci/datamigration/generated/api/Support/SsisStoreType.Completer.cs new file mode 100644 index 000000000000..df351479bde6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisStoreType.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of supported source SSIS store type in DMS + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreTypeTypeConverter))] + public partial struct SsisStoreType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SsisCatalog".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SsisCatalog'", "SsisCatalog", global::System.Management.Automation.CompletionResultType.ParameterValue, "SsisCatalog"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisStoreType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SsisStoreType.TypeConverter.cs new file mode 100644 index 000000000000..dfd04f339975 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisStoreType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of supported source SSIS store type in DMS + public partial class SsisStoreTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SsisStoreType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SsisStoreType.cs b/swaggerci/datamigration/generated/api/Support/SsisStoreType.cs new file mode 100644 index 000000000000..6fd1d8cd18b6 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SsisStoreType.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// An enumeration of supported source SSIS store type in DMS + public partial struct SsisStoreType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType SsisCatalog = @"SsisCatalog"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SsisStoreType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SsisStoreType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SsisStoreType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SsisStoreType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SsisStoreType && Equals((SsisStoreType)obj); + } + + /// Returns hashCode for enum SsisStoreType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SsisStoreType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SsisStoreType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SsisStoreType + /// the value to convert to an instance of . + + public static implicit operator SsisStoreType(string value) + { + return new SsisStoreType(value); + } + + /// Implicit operator to convert SsisStoreType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType e) + { + return e._value; + } + + /// Overriding != operator for enum SsisStoreType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SsisStoreType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SsisStoreType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.Completer.cs b/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.Completer.cs new file mode 100644 index 000000000000..9f8e050d793d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.Completer.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different state of database level online migration. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingStateTypeConverter))] + public partial struct SyncDatabaseMigrationReportingState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UNDEFINED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UNDEFINED'", "UNDEFINED", global::System.Management.Automation.CompletionResultType.ParameterValue, "UNDEFINED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CONFIGURING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CONFIGURING'", "CONFIGURING", global::System.Management.Automation.CompletionResultType.ParameterValue, "CONFIGURING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "INITIALIAZING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'INITIALIAZING'", "INITIALIAZING", global::System.Management.Automation.CompletionResultType.ParameterValue, "INITIALIAZING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "STARTING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'STARTING'", "STARTING", global::System.Management.Automation.CompletionResultType.ParameterValue, "STARTING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RUNNING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RUNNING'", "RUNNING", global::System.Management.Automation.CompletionResultType.ParameterValue, "RUNNING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "READY_TO_COMPLETE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'READY_TO_COMPLETE'", "READY_TO_COMPLETE", global::System.Management.Automation.CompletionResultType.ParameterValue, "READY_TO_COMPLETE"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "COMPLETING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'COMPLETING'", "COMPLETING", global::System.Management.Automation.CompletionResultType.ParameterValue, "COMPLETING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "COMPLETE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'COMPLETE'", "COMPLETE", global::System.Management.Automation.CompletionResultType.ParameterValue, "COMPLETE"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CANCELLING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CANCELLING'", "CANCELLING", global::System.Management.Automation.CompletionResultType.ParameterValue, "CANCELLING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CANCELLED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CANCELLED'", "CANCELLED", global::System.Management.Automation.CompletionResultType.ParameterValue, "CANCELLED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FAILED'", "FAILED", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VALIDATING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VALIDATING'", "VALIDATING", global::System.Management.Automation.CompletionResultType.ParameterValue, "VALIDATING"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VALIDATION_COMPLETE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VALIDATION_COMPLETE'", "VALIDATION_COMPLETE", global::System.Management.Automation.CompletionResultType.ParameterValue, "VALIDATION_COMPLETE"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VALIDATION_FAILED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VALIDATION_FAILED'", "VALIDATION_FAILED", global::System.Management.Automation.CompletionResultType.ParameterValue, "VALIDATION_FAILED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RESTORE_IN_PROGRESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RESTORE_IN_PROGRESS'", "RESTORE_IN_PROGRESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "RESTORE_IN_PROGRESS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RESTORE_COMPLETED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RESTORE_COMPLETED'", "RESTORE_COMPLETED", global::System.Management.Automation.CompletionResultType.ParameterValue, "RESTORE_COMPLETED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BACKUP_IN_PROGRESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BACKUP_IN_PROGRESS'", "BACKUP_IN_PROGRESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "BACKUP_IN_PROGRESS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BACKUP_COMPLETED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BACKUP_COMPLETED'", "BACKUP_COMPLETED", global::System.Management.Automation.CompletionResultType.ParameterValue, "BACKUP_COMPLETED"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.TypeConverter.cs new file mode 100644 index 000000000000..cfdcc6dcc98c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different state of database level online migration. + public partial class SyncDatabaseMigrationReportingStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SyncDatabaseMigrationReportingState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.cs b/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.cs new file mode 100644 index 000000000000..46c9abda6fae --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SyncDatabaseMigrationReportingState.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different state of database level online migration. + public partial struct SyncDatabaseMigrationReportingState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState BackupCompleted = @"BACKUP_COMPLETED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState BackupInProgress = @"BACKUP_IN_PROGRESS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Cancelled = @"CANCELLED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Cancelling = @"CANCELLING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Complete = @"COMPLETE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Completing = @"COMPLETING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Configuring = @"CONFIGURING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Failed = @"FAILED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Initialiazing = @"INITIALIAZING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState ReadyToComplete = @"READY_TO_COMPLETE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState RestoreCompleted = @"RESTORE_COMPLETED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState RestoreInProgress = @"RESTORE_IN_PROGRESS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Running = @"RUNNING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Starting = @"STARTING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Undefined = @"UNDEFINED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState Validating = @"VALIDATING"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState ValidationComplete = @"VALIDATION_COMPLETE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState ValidationFailed = @"VALIDATION_FAILED"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to SyncDatabaseMigrationReportingState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SyncDatabaseMigrationReportingState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SyncDatabaseMigrationReportingState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type SyncDatabaseMigrationReportingState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SyncDatabaseMigrationReportingState && Equals((SyncDatabaseMigrationReportingState)obj); + } + + /// Returns hashCode for enum SyncDatabaseMigrationReportingState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private SyncDatabaseMigrationReportingState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SyncDatabaseMigrationReportingState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SyncDatabaseMigrationReportingState + /// the value to convert to an instance of . + + public static implicit operator SyncDatabaseMigrationReportingState(string value) + { + return new SyncDatabaseMigrationReportingState(value); + } + + /// Implicit operator to convert SyncDatabaseMigrationReportingState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState e) + { + return e._value; + } + + /// Overriding != operator for enum SyncDatabaseMigrationReportingState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SyncDatabaseMigrationReportingState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncDatabaseMigrationReportingState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.Completer.cs b/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.Completer.cs new file mode 100644 index 000000000000..f1f7f6532f17 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different state of table level online migration. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationStateTypeConverter))] + public partial struct SyncTableMigrationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BEFORE_LOAD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BEFORE_LOAD'", "BEFORE_LOAD", global::System.Management.Automation.CompletionResultType.ParameterValue, "BEFORE_LOAD"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FULL_LOAD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FULL_LOAD'", "FULL_LOAD", global::System.Management.Automation.CompletionResultType.ParameterValue, "FULL_LOAD"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "COMPLETED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'COMPLETED'", "COMPLETED", global::System.Management.Automation.CompletionResultType.ParameterValue, "COMPLETED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CANCELED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CANCELED'", "CANCELED", global::System.Management.Automation.CompletionResultType.ParameterValue, "CANCELED"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ERROR".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ERROR'", "ERROR", global::System.Management.Automation.CompletionResultType.ParameterValue, "ERROR"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILED".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FAILED'", "FAILED", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILED"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.TypeConverter.cs new file mode 100644 index 000000000000..4fcbdd055390 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different state of table level online migration. + public partial class SyncTableMigrationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SyncTableMigrationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.cs b/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.cs new file mode 100644 index 000000000000..9b2df0233d5c --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/SyncTableMigrationState.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Enum of the different state of table level online migration. + public partial struct SyncTableMigrationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState BeforeLoad = @"BEFORE_LOAD"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState Canceled = @"CANCELED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState Completed = @"COMPLETED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState Error = @"ERROR"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState Failed = @"FAILED"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState FullLoad = @"FULL_LOAD"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SyncTableMigrationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SyncTableMigrationState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SyncTableMigrationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SyncTableMigrationState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SyncTableMigrationState && Equals((SyncTableMigrationState)obj); + } + + /// Returns hashCode for enum SyncTableMigrationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SyncTableMigrationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SyncTableMigrationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SyncTableMigrationState + /// the value to convert to an instance of . + + public static implicit operator SyncTableMigrationState(string value) + { + return new SyncTableMigrationState(value); + } + + /// Implicit operator to convert SyncTableMigrationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState e) + { + return e._value; + } + + /// Overriding != operator for enum SyncTableMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SyncTableMigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.SyncTableMigrationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/TaskState.Completer.cs b/swaggerci/datamigration/generated/api/Support/TaskState.Completer.cs new file mode 100644 index 000000000000..1a7b411b94b9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/TaskState.Completer.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The state of the task. This is ignored if submitted. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskStateTypeConverter))] + public partial struct TaskState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Queued".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Queued'", "Queued", global::System.Management.Automation.CompletionResultType.ParameterValue, "Queued"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FailedInputValidation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FailedInputValidation'", "FailedInputValidation", global::System.Management.Automation.CompletionResultType.ParameterValue, "FailedInputValidation"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Faulted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Faulted'", "Faulted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Faulted"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/TaskState.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/TaskState.TypeConverter.cs new file mode 100644 index 000000000000..9b2f177a93c9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/TaskState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The state of the task. This is ignored if submitted. + public partial class TaskStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TaskState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/TaskState.cs b/swaggerci/datamigration/generated/api/Support/TaskState.cs new file mode 100644 index 000000000000..1072a4a1e188 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/TaskState.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// The state of the task. This is ignored if submitted. + public partial struct TaskState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState FailedInputValidation = @"FailedInputValidation"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState Faulted = @"Faulted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState Queued = @"Queued"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState Running = @"Running"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TaskState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TaskState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TaskState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TaskState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TaskState && Equals((TaskState)obj); + } + + /// Returns hashCode for enum TaskState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private TaskState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TaskState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TaskState + /// the value to convert to an instance of . + + public static implicit operator TaskState(string value) + { + return new TaskState(value); + } + + /// Implicit operator to convert TaskState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState e) + { + return e._value; + } + + /// Overriding != operator for enum TaskState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TaskState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/TaskType.Completer.cs b/swaggerci/datamigration/generated/api/Support/TaskType.Completer.cs new file mode 100644 index 000000000000..c4f5d8f7d265 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/TaskType.Completer.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Task type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskTypeTypeConverter))] + public partial struct TaskType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Connect.MongoDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Connect.MongoDb'", "Connect.MongoDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "Connect.MongoDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToSource.SqlServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToSource.SqlServer'", "ConnectToSource.SqlServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToSource.SqlServer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToSource.SqlServer.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToSource.SqlServer.Sync'", "ConnectToSource.SqlServer.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToSource.SqlServer.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToSource.PostgreSql.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToSource.PostgreSql.Sync'", "ConnectToSource.PostgreSql.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToSource.PostgreSql.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToSource.MySql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToSource.MySql'", "ConnectToSource.MySql", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToSource.MySql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToSource.Oracle.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToSource.Oracle.Sync'", "ConnectToSource.Oracle.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToSource.Oracle.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToTarget.SqlDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToTarget.SqlDb'", "ConnectToTarget.SqlDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToTarget.SqlDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToTarget.SqlDb.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToTarget.SqlDb.Sync'", "ConnectToTarget.SqlDb.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToTarget.SqlDb.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToTarget.AzureDbForPostgreSql.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToTarget.AzureDbForPostgreSql.Sync'", "ConnectToTarget.AzureDbForPostgreSql.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToTarget.AzureDbForPostgreSql.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync'", "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToTarget.AzureSqlDbMI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToTarget.AzureSqlDbMI'", "ConnectToTarget.AzureSqlDbMI", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToTarget.AzureSqlDbMI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToTarget.AzureSqlDbMI.Sync.LRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToTarget.AzureSqlDbMI.Sync.LRS'", "ConnectToTarget.AzureSqlDbMI.Sync.LRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToTarget.AzureSqlDbMI.Sync.LRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConnectToTarget.AzureDbForMySql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConnectToTarget.AzureDbForMySql'", "ConnectToTarget.AzureDbForMySql", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConnectToTarget.AzureDbForMySql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GetUserTables.Sql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GetUserTables.Sql'", "GetUserTables.Sql", global::System.Management.Automation.CompletionResultType.ParameterValue, "GetUserTables.Sql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GetUserTables.AzureSqlDb.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GetUserTables.AzureSqlDb.Sync'", "GetUserTables.AzureSqlDb.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "GetUserTables.AzureSqlDb.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GetUserTablesOracle".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GetUserTablesOracle'", "GetUserTablesOracle", global::System.Management.Automation.CompletionResultType.ParameterValue, "GetUserTablesOracle"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GetUserTablesPostgreSql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GetUserTablesPostgreSql'", "GetUserTablesPostgreSql", global::System.Management.Automation.CompletionResultType.ParameterValue, "GetUserTablesPostgreSql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GetUserTablesMySql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GetUserTablesMySql'", "GetUserTablesMySql", global::System.Management.Automation.CompletionResultType.ParameterValue, "GetUserTablesMySql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.MongoDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.MongoDb'", "Migrate.MongoDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.MongoDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.SqlServer.AzureSqlDbMI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.SqlServer.AzureSqlDbMI'", "Migrate.SqlServer.AzureSqlDbMI", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.SqlServer.AzureSqlDbMI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.SqlServer.AzureSqlDbMI.Sync.LRS'", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.SqlServer.SqlDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.SqlServer.SqlDb'", "Migrate.SqlServer.SqlDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.SqlServer.SqlDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.SqlServer.AzureSqlDb.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.SqlServer.AzureSqlDb.Sync'", "Migrate.SqlServer.AzureSqlDb.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.SqlServer.AzureSqlDb.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.MySql.AzureDbForMySql.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.MySql.AzureDbForMySql.Sync'", "Migrate.MySql.AzureDbForMySql.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.MySql.AzureDbForMySql.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.MySql.AzureDbForMySql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.MySql.AzureDbForMySql'", "Migrate.MySql.AzureDbForMySql", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.MySql.AzureDbForMySql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2'", "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.Oracle.AzureDbForPostgreSql.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.Oracle.AzureDbForPostgreSql.Sync'", "Migrate.Oracle.AzureDbForPostgreSql.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.Oracle.AzureDbForPostgreSql.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidateMigrationInput.SqlServer.SqlDb.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidateMigrationInput.SqlServer.SqlDb.Sync'", "ValidateMigrationInput.SqlServer.SqlDb.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidateMigrationInput.SqlServer.SqlDb.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidateMigrationInput.SqlServer.AzureSqlDbMI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidateMigrationInput.SqlServer.AzureSqlDbMI'", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidateMigrationInput.SqlServer.AzureSqlDbMI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS'", "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Validate.MongoDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Validate.MongoDb'", "Validate.MongoDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "Validate.MongoDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Validate.Oracle.AzureDbPostgreSql.Sync".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Validate.Oracle.AzureDbPostgreSql.Sync'", "Validate.Oracle.AzureDbPostgreSql.Sync", global::System.Management.Automation.CompletionResultType.ParameterValue, "Validate.Oracle.AzureDbPostgreSql.Sync"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GetTDECertificates.Sql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GetTDECertificates.Sql'", "GetTDECertificates.Sql", global::System.Management.Automation.CompletionResultType.ParameterValue, "GetTDECertificates.Sql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrate.Ssis".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Migrate.Ssis'", "Migrate.Ssis", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrate.Ssis"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Service.Check.OCI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Service.Check.OCI'", "Service.Check.OCI", global::System.Management.Automation.CompletionResultType.ParameterValue, "Service.Check.OCI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Service.Upload.OCI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Service.Upload.OCI'", "Service.Upload.OCI", global::System.Management.Automation.CompletionResultType.ParameterValue, "Service.Upload.OCI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Service.Install.OCI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Service.Install.OCI'", "Service.Install.OCI", global::System.Management.Automation.CompletionResultType.ParameterValue, "Service.Install.OCI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MigrateSchemaSqlServerSqlDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MigrateSchemaSqlServerSqlDb'", "MigrateSchemaSqlServerSqlDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "MigrateSchemaSqlServerSqlDb"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/TaskType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/TaskType.TypeConverter.cs new file mode 100644 index 000000000000..1bca40aa27b1 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/TaskType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Task type. + public partial class TaskTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TaskType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/TaskType.cs b/swaggerci/datamigration/generated/api/Support/TaskType.cs new file mode 100644 index 000000000000..ebe55cd0af73 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/TaskType.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Task type. + public partial struct TaskType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectMongoDb = @"Connect.MongoDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToSourceMySql = @"ConnectToSource.MySql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToSourceOracleSync = @"ConnectToSource.Oracle.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToSourcePostgreSqlSync = @"ConnectToSource.PostgreSql.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToSourceSqlServer = @"ConnectToSource.SqlServer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToSourceSqlServerSync = @"ConnectToSource.SqlServer.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToTargetAzureDbForMySql = @"ConnectToTarget.AzureDbForMySql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToTargetAzureDbForPostgreSqlSync = @"ConnectToTarget.AzureDbForPostgreSql.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToTargetAzureSqlDbMi = @"ConnectToTarget.AzureSqlDbMI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToTargetAzureSqlDbMiSyncLrs = @"ConnectToTarget.AzureSqlDbMI.Sync.LRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToTargetOracleAzureDbForPostgreSqlSync = @"ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToTargetSqlDb = @"ConnectToTarget.SqlDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ConnectToTargetSqlDbSync = @"ConnectToTarget.SqlDb.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType GetTdeCertificatesSql = @"GetTDECertificates.Sql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType GetUserTablesAzureSqlDbSync = @"GetUserTables.AzureSqlDb.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType GetUserTablesMySql = @"GetUserTablesMySql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType GetUserTablesOracle = @"GetUserTablesOracle"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType GetUserTablesPostgreSql = @"GetUserTablesPostgreSql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType GetUserTablesSql = @"GetUserTables.Sql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateMongoDb = @"Migrate.MongoDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateMySqlAzureDbForMySql = @"Migrate.MySql.AzureDbForMySql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateMySqlAzureDbForMySqlSync = @"Migrate.MySql.AzureDbForMySql.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateOracleAzureDbForPostgreSqlSync = @"Migrate.Oracle.AzureDbForPostgreSql.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigratePostgreSqlAzureDbForPostgreSqlSyncV2 = @"Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateSchemaSqlServerSqlDb = @"MigrateSchemaSqlServerSqlDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateSqlServerAzureSqlDbMi = @"Migrate.SqlServer.AzureSqlDbMI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateSqlServerAzureSqlDbMiSyncLrs = @"Migrate.SqlServer.AzureSqlDbMI.Sync.LRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateSqlServerAzureSqlDbSync = @"Migrate.SqlServer.AzureSqlDb.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateSqlServerSqlDb = @"Migrate.SqlServer.SqlDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType MigrateSsis = @"Migrate.Ssis"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ServiceCheckOci = @"Service.Check.OCI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ServiceInstallOci = @"Service.Install.OCI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ServiceUploadOci = @"Service.Upload.OCI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ValidateMigrationInputSqlServerAzureSqlDbMi = @"ValidateMigrationInput.SqlServer.AzureSqlDbMI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ValidateMigrationInputSqlServerAzureSqlDbMiSyncLrs = @"ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ValidateMigrationInputSqlServerSqlDbSync = @"ValidateMigrationInput.SqlServer.SqlDb.Sync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ValidateMongoDb = @"Validate.MongoDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType ValidateOracleAzureDbPostgreSqlSync = @"Validate.Oracle.AzureDbPostgreSql.Sync"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TaskType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TaskType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TaskType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TaskType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TaskType && Equals((TaskType)obj); + } + + /// Returns hashCode for enum TaskType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private TaskType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TaskType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TaskType + /// the value to convert to an instance of . + + public static implicit operator TaskType(string value) + { + return new TaskType(value); + } + + /// Implicit operator to convert TaskType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType e) + { + return e._value; + } + + /// Overriding != operator for enum TaskType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TaskType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/UpdateActionType.Completer.cs b/swaggerci/datamigration/generated/api/Support/UpdateActionType.Completer.cs new file mode 100644 index 000000000000..df94c05e315d --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/UpdateActionType.Completer.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Type of the actual difference for the compared object, while performing schema comparison + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionTypeTypeConverter))] + public partial struct UpdateActionType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DeletedOnTarget".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DeletedOnTarget'", "DeletedOnTarget", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeletedOnTarget"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ChangedOnTarget".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ChangedOnTarget'", "ChangedOnTarget", global::System.Management.Automation.CompletionResultType.ParameterValue, "ChangedOnTarget"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AddedOnTarget".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AddedOnTarget'", "AddedOnTarget", global::System.Management.Automation.CompletionResultType.ParameterValue, "AddedOnTarget"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/UpdateActionType.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/UpdateActionType.TypeConverter.cs new file mode 100644 index 000000000000..6582fc08023b --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/UpdateActionType.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Type of the actual difference for the compared object, while performing schema comparison + /// + public partial class UpdateActionTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => UpdateActionType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/UpdateActionType.cs b/swaggerci/datamigration/generated/api/Support/UpdateActionType.cs new file mode 100644 index 000000000000..a5c4069d53fe --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/UpdateActionType.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// + /// Type of the actual difference for the compared object, while performing schema comparison + /// + public partial struct UpdateActionType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType AddedOnTarget = @"AddedOnTarget"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType ChangedOnTarget = @"ChangedOnTarget"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType DeletedOnTarget = @"DeletedOnTarget"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UpdateActionType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UpdateActionType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UpdateActionType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UpdateActionType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is UpdateActionType && Equals((UpdateActionType)obj); + } + + /// Returns hashCode for enum UpdateActionType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UpdateActionType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private UpdateActionType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UpdateActionType + /// the value to convert to an instance of . + + public static implicit operator UpdateActionType(string value) + { + return new UpdateActionType(value); + } + + /// Implicit operator to convert UpdateActionType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType e) + { + return e._value; + } + + /// Overriding != operator for enum UpdateActionType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UpdateActionType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.UpdateActionType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ValidationStatus.Completer.cs b/swaggerci/datamigration/generated/api/Support/ValidationStatus.Completer.cs new file mode 100644 index 000000000000..1eff3733f713 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ValidationStatus.Completer.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current status of the validation + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatusTypeConverter))] + public partial struct ValidationStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Default'", "Default", global::System.Management.Automation.CompletionResultType.ParameterValue, "Default"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotStarted'", "NotStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initialized".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initialized'", "Initialized", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initialized"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompletedWithIssues".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompletedWithIssues'", "CompletedWithIssues", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompletedWithIssues"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stopped'", "Stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopped"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ValidationStatus.TypeConverter.cs b/swaggerci/datamigration/generated/api/Support/ValidationStatus.TypeConverter.cs new file mode 100644 index 000000000000..644bdffd6c91 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ValidationStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current status of the validation + public partial class ValidationStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ValidationStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/api/Support/ValidationStatus.cs b/swaggerci/datamigration/generated/api/Support/ValidationStatus.cs new file mode 100644 index 000000000000..73bdd11071d9 --- /dev/null +++ b/swaggerci/datamigration/generated/api/Support/ValidationStatus.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support +{ + + /// Current status of the validation + public partial struct ValidationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus CompletedWithIssues = @"CompletedWithIssues"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus Default = @"Default"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus Initialized = @"Initialized"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus NotStarted = @"NotStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus Stopped = @"Stopped"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ValidationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ValidationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ValidationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ValidationStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ValidationStatus && Equals((ValidationStatus)obj); + } + + /// Returns hashCode for enum ValidationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ValidationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private ValidationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to ValidationStatus + /// the value to convert to an instance of . + + public static implicit operator ValidationStatus(string value) + { + return new ValidationStatus(value); + } + + /// Implicit operator to convert ValidationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ValidationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ValidationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ValidationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlDb_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlDb_Get.cs new file mode 100644 index 000000000000..84b95c66c964 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlDb_Get.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the Database Migration resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationDatabaseMigrationsSqlDb_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the Database Migration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationDatabaseMigrationsSqlDb_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Complete migration details be included in the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Complete migration details be included in the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Complete migration details be included in the response.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlDbInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlDbInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlDbInstanceName { get => this._sqlDbInstanceName; set => this._sqlDbInstanceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationDatabaseMigrationsSqlDb_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlDbGet(ResourceGroupName, SqlDbInstanceName, TargetDbName, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlDbInstanceName=SqlDbInstanceName,TargetDbName=TargetDbName,MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlDbInstanceName=SqlDbInstanceName, TargetDbName=TargetDbName, MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity.cs new file mode 100644 index 000000000000..d0fbed886920 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the Database Migration resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the Database Migration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Complete migration details be included in the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Complete migration details be included in the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Complete migration details be included in the response.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationDatabaseMigrationsSqlDb_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlDbGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlDbInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlDbInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlDbGet(InputObject.ResourceGroupName ?? null, InputObject.SqlDbInstanceName ?? null, InputObject.TargetDbName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlMi_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlMi_Get.cs new file mode 100644 index 000000000000..b93ff14d57c4 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlMi_Get.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the specified database migration for a given SQL Managed Instance. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationDatabaseMigrationsSqlMi_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the specified database migration for a given SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationDatabaseMigrationsSqlMi_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Complete migration details be included in the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Complete migration details be included in the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Complete migration details be included in the response.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managedInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"managedInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ManagedInstanceName { get => this._managedInstanceName; set => this._managedInstanceName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationDatabaseMigrationsSqlMi_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlMiGet(ResourceGroupName, ManagedInstanceName, TargetDbName, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ManagedInstanceName=ManagedInstanceName,TargetDbName=TargetDbName,MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ManagedInstanceName=ManagedInstanceName, TargetDbName=TargetDbName, MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity.cs new file mode 100644 index 000000000000..a28c94d37dc8 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the specified database migration for a given SQL Managed Instance. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the specified database migration for a given SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Complete migration details be included in the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Complete migration details be included in the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Complete migration details be included in the response.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationDatabaseMigrationsSqlMi_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlMiGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagedInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagedInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlMiGet(InputObject.ResourceGroupName ?? null, InputObject.ManagedInstanceName ?? null, InputObject.TargetDbName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlVM_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlVM_Get.cs new file mode 100644 index 000000000000..7f2350634d36 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlVM_Get.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the specified database migration for a given SQL VM. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationDatabaseMigrationsSqlVM_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the specified database migration for a given SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationDatabaseMigrationsSqlVM_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Complete migration details be included in the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Complete migration details be included in the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Complete migration details be included in the response.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlVirtualMachineName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlVirtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlVirtualMachineName { get => this._sqlVirtualMachineName; set => this._sqlVirtualMachineName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationDatabaseMigrationsSqlVM_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlVMGet(ResourceGroupName, SqlVirtualMachineName, TargetDbName, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlVirtualMachineName=SqlVirtualMachineName,TargetDbName=TargetDbName,MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlVirtualMachineName=SqlVirtualMachineName, TargetDbName=TargetDbName, MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity.cs new file mode 100644 index 000000000000..bf4d3be6672a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the specified database migration for a given SQL VM. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the specified database migration for a given SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Complete migration details be included in the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Complete migration details be included in the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Complete migration details be included in the response.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string MigrationOperationId { get => this._migrationOperationId; set => this._migrationOperationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationDatabaseMigrationsSqlVM_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlVMGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlVirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlVirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlVMGet(InputObject.ResourceGroupName ?? null, InputObject.SqlVirtualMachineName ?? null, InputObject.TargetDbName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { MigrationOperationId=this.InvocationInformation.BoundParameters.ContainsKey("MigrationOperationId") ? MigrationOperationId : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_Get.cs new file mode 100644 index 000000000000..f97f352dfdbe --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_Get.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method + /// retrieves information about a file. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationFile_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationFile_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the File + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the File")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the File", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationFile_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesGet(SubscriptionId, GroupName, ServiceName, ProjectName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_GetViaIdentity.cs new file mode 100644 index 000000000000..e328ba8f2433 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_GetViaIdentity.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method + /// retrieves information about a file. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationFile_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationFile_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationFile_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FilesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FilesGet(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.FileName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_List.cs new file mode 100644 index 000000000000..0956aa97339c --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationFile_List.cs @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. This method returns a list of files + /// owned by a project resource. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationFile_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationFile_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationFile_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesList(SubscriptionId, GroupName, ServiceName, ProjectName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationOperation_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationOperation_List.cs new file mode 100644 index 000000000000..c4aced1e4a1d --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationOperation_List.cs @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Lists all of the available SQL Migration REST API operations. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.DataMigration/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Lists all of the available SQL Migration REST API operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationOperation_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_Get.cs new file mode 100644 index 000000000000..7813937fd660 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_Get.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. The GET method retrieves information + /// about a project. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationProject_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationProject_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ProjectName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationProject_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ProjectsGet(SubscriptionId, GroupName, ServiceName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_GetViaIdentity.cs new file mode 100644 index 000000000000..8b7fbc46d7c7 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_GetViaIdentity.cs @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. The GET method retrieves information + /// about a project. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationProject_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationProject_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationProject_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ProjectsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ProjectsGet(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_List.cs new file mode 100644 index 000000000000..dd616acf3e2b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationProject_List.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. This method returns a list of projects + /// owned by a service resource. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationProject_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationProject_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationProject_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ProjectsList(SubscriptionId, GroupName, ServiceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ProjectsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationResourceSku_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationResourceSku_List.cs new file mode 100644 index 000000000000..b35139807bbf --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationResourceSku_List.cs @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// The skus action returns the list of SKUs that DMS supports. + /// + /// [OpenAPI] ListSkus=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationResourceSku_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IResourceSku))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The skus action returns the list of SKUs that DMS supports.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationResourceSku_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationResourceSku_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ResourceSkusListSkus(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ResourceSkusListSkus_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceSku_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceSku_List.cs new file mode 100644 index 000000000000..f7fa2840c084 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceSku_List.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] ListSkus=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationServiceSku_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAvailableServiceSku))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationServiceSku_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationServiceSku_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesListSkus(SubscriptionId, GroupName, ServiceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesListSkus_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_Get.cs new file mode 100644 index 000000000000..a8144c7d556c --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_Get.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + /// retrieves information about a service task. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationServiceTask_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a service task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationServiceTask_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Expand the response + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expand the response")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expand the response", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationServiceTask_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServiceTasksGet(SubscriptionId, GroupName, ServiceName, TaskName, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,TaskName=TaskName,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_GetViaIdentity.cs new file mode 100644 index 000000000000..58e64fd9af32 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_GetViaIdentity.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + /// retrieves information about a service task. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationServiceTask_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a service task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationServiceTask_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Expand the response + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expand the response")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expand the response", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationServiceTask_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServiceTasksGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServiceTasksGet(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.TaskName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_List.cs new file mode 100644 index 000000000000..a290cd7f8bd7 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationServiceTask_List.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. This method returns a + /// list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that + /// an error occurred while querying the status of that task. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationServiceTask_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationServiceTask_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskType; + + /// Filter tasks by task type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Filter tasks by task type")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Filter tasks by task type", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string TaskType { get => this._taskType; set => this._taskType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationServiceTask_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServiceTasksList(SubscriptionId, GroupName, ServiceName, this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,TaskType=this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskType=this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskType=this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServiceTasksList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_Get.cs new file mode 100644 index 000000000000..0be1ad1b6f81 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_Get.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves + /// information about a service instance. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationService_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationService_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationService_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesGet(SubscriptionId, GroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_GetViaIdentity.cs new file mode 100644 index 000000000000..fb2bf9e53ce2 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_GetViaIdentity.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves + /// information about a service instance. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationService_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationService_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationService_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesGet(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_List.cs new file mode 100644 index 000000000000..cf826155c13b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_List.cs @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationService_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationService_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationService_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesListByResourceGroup(SubscriptionId, GroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_List1.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_List1.cs new file mode 100644 index 000000000000..be971eb72bda --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationService_List1.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationService_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationService_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationService_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceAuthKey_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceAuthKey_List.cs new file mode 100644 index 000000000000..3113ce79b84f --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceAuthKey_List.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + /// + /// [OpenAPI] ListAuthKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationSqlMigrationServiceAuthKey_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the List of Authentication Keys for Self Hosted Integration Runtime.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationSqlMigrationServiceAuthKey_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationSqlMigrationServiceAuthKey_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesListAuthKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListAuthKeys(ResourceGroupName, SqlMigrationServiceName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlMigrationServiceName=SqlMigrationServiceName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlMigrationServiceName=SqlMigrationServiceName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IAuthenticationKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceMigration_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceMigration_List.cs new file mode 100644 index 000000000000..759f8e1c4756 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceMigration_List.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the List of database migrations attached to the service. + /// + /// [OpenAPI] ListMigrations=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationSqlMigrationServiceMigration_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the List of database migrations attached to the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationSqlMigrationServiceMigration_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationSqlMigrationServiceMigration_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListMigrations(ResourceGroupName, SqlMigrationServiceName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlMigrationServiceName=SqlMigrationServiceName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlMigrationServiceName=SqlMigrationServiceName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListMigrations_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceMonitoringData_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceMonitoringData_List.cs new file mode 100644 index 000000000000..96a7912888c7 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationServiceMonitoringData_List.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service. + /// + /// + /// [OpenAPI] ListMonitoringData=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationSqlMigrationServiceMonitoringData_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationSqlMigrationServiceMonitoringData_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationSqlMigrationServiceMonitoringData_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesListMonitoringData' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListMonitoringData(ResourceGroupName, SqlMigrationServiceName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlMigrationServiceName=SqlMigrationServiceName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlMigrationServiceName=SqlMigrationServiceName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IIntegrationRuntimeMonitoringData + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_Get.cs new file mode 100644 index 000000000000..64487b618f3c --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_Get.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the Database Migration Service + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationSqlMigrationService_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the Database Migration Service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationSqlMigrationService_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SqlMigrationServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationSqlMigrationService_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesGet(ResourceGroupName, Name, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,Name=Name,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_GetViaIdentity.cs new file mode 100644 index 000000000000..3a0aeb01de6b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve the Database Migration Service + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationSqlMigrationService_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve the Database Migration Service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationSqlMigrationService_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationSqlMigrationService_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SqlMigrationServicesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlMigrationServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlMigrationServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SqlMigrationServicesGet(InputObject.ResourceGroupName ?? null, InputObject.SqlMigrationServiceName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_List.cs new file mode 100644 index 000000000000..2ecc23f39458 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_List.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve all SQL migration services in the resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationSqlMigrationService_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve all SQL migration services in the resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationSqlMigrationService_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationSqlMigrationService_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListByResourceGroup(ResourceGroupName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_List1.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_List1.cs new file mode 100644 index 000000000000..8c135fefca22 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationSqlMigrationService_List1.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Retrieve all SQL migration services in the subscriptions. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationSqlMigrationService_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Retrieve all SQL migration services in the subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationSqlMigrationService_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationSqlMigrationService_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListBySubscription(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_Get.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_Get.cs new file mode 100644 index 000000000000..5c1486c3ab2e --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_Get.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves + /// information about a task. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationTask_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationTask_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Expand the response + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expand the response")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expand the response", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TaskName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationTask_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksGet(SubscriptionId, GroupName, ServiceName, ProjectName, Name, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_GetViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_GetViaIdentity.cs new file mode 100644 index 000000000000..eeb06263bfef --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_GetViaIdentity.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves + /// information about a task. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationTask_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationTask_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Expand the response + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expand the response")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expand the response", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationTask_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TasksGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TasksGet(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.TaskName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_List.cs new file mode 100644 index 000000000000..7c6a18bf2ddb --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationTask_List.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationTask_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationTask_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskType; + + /// Filter tasks by task type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Filter tasks by task type")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Filter tasks by task type", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public string TaskType { get => this._taskType; set => this._taskType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationTask_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksList(SubscriptionId, GroupName, ServiceName, ProjectName, this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,TaskType=this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, TaskType=this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, TaskType=this.InvocationInformation.BoundParameters.ContainsKey("TaskType") ? TaskType : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationUsage_List.cs b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationUsage_List.cs new file mode 100644 index 000000000000..d85ccfa1e090 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/GetAzDataMigrationUsage_List.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method returns region-specific quotas and resource usage information for the Database Migration Service. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataMigrationUsage_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IQuota))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method returns region-specific quotas and resource usage information for the Database Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class GetAzDataMigrationUsage_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// The Azure region of the operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Azure region of the operation")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Azure region of the operation", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzDataMigrationUsage_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsagesList(SubscriptionId, Location, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsagesList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_Command.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_Command.cs new file mode 100644 index 000000000000..24baf6bc6f6c --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_Command.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes + /// a command on a running task. + /// + /// + /// [OpenAPI] Command=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCommandTask_Command", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCommandTask_Command : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties _parameter; + + /// + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Base class for all types of DMS command properties. If command is not supported by current client, this object is returned.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Base class for all types of DMS command properties. If command is not supported by current client, this object is returned.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCommandTask_Command() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksCommand' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksCommand(SubscriptionId, GroupName, ServiceName, ProjectName, TaskName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,TaskName=TaskName,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, TaskName=TaskName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, TaskName=TaskName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandExpanded.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandExpanded.cs new file mode 100644 index 000000000000..07f6d2d102ff --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandExpanded.cs @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes + /// a command on a running task. + /// + /// + /// [OpenAPI] Command=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCommandTask_CommandExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCommandTask_CommandExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Command type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Command type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Command type.", + SerializedName = @"commandType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => ParametersBody.CommandType; set => ParametersBody.CommandType = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(); + + /// + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCommandTask_CommandExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksCommand' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksCommand(SubscriptionId, GroupName, ServiceName, ProjectName, TaskName, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,TaskName=TaskName,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, TaskName=TaskName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, TaskName=TaskName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandViaIdentity.cs new file mode 100644 index 000000000000..cd67e5234aa6 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandViaIdentity.cs @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes + /// a command on a running task. + /// + /// + /// [OpenAPI] Command=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCommandTask_CommandViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCommandTask_CommandViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties _parameter; + + /// + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Base class for all types of DMS command properties. If command is not supported by current client, this object is returned.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Base class for all types of DMS command properties. If command is not supported by current client, this object is returned.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCommandTask_CommandViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksCommand' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TasksCommandViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TasksCommand(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.TaskName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandViaIdentityExpanded.cs new file mode 100644 index 000000000000..8a79855f734a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCommandTask_CommandViaIdentityExpanded.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes + /// a command on a running task. + /// + /// + /// [OpenAPI] Command=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCommandTask_CommandViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCommandTask_CommandViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Command type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Command type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Command type.", + SerializedName = @"commandType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.CommandType CommandType { get => ParametersBody.CommandType; set => ParametersBody.CommandType = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.CommandProperties(); + + /// + /// Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCommandTask_CommandViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksCommand' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TasksCommandViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TasksCommand(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.TaskName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ICommandProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover.cs new file mode 100644 index 000000000000..8254888d313f --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Initiate cutover for in-progress online database migration to SQL Managed Instance. + /// + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managedInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"managedInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ManagedInstanceName { get => this._managedInstanceName; set => this._managedInstanceName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagedInstanceName = this.ManagedInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_Cutover() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlMiCutover(ResourceGroupName, ManagedInstanceName, TargetDbName, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ManagedInstanceName=ManagedInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ManagedInstanceName=ManagedInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded.cs new file mode 100644 index 000000000000..744e752f8846 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Initiate cutover for in-progress online database migration to SQL Managed Instance. + /// + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managedInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"managedInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ManagedInstanceName { get => this._managedInstanceName; set => this._managedInstanceName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagedInstanceName = this.ManagedInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlMiCutover(ResourceGroupName, ManagedInstanceName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ManagedInstanceName=ManagedInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ManagedInstanceName=ManagedInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity.cs new file mode 100644 index 000000000000..d5bb5a2718d1 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity.cs @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Initiate cutover for in-progress online database migration to SQL Managed Instance. + /// + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlMiCutoverViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagedInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagedInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlMiCutover(InputObject.ResourceGroupName ?? null, InputObject.ManagedInstanceName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded.cs new file mode 100644 index 000000000000..4c9becb8bbae --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded.cs @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Initiate cutover for in-progress online database migration to SQL Managed Instance. + /// + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlMi_CutoverViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlMiCutoverViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagedInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagedInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlMiCutover(InputObject.ResourceGroupName ?? null, InputObject.ManagedInstanceName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover.cs new file mode 100644 index 000000000000..462bc0131d52 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Initiate cutover for in-progress online database migration to SQL VM. + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlVirtualMachineName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlVirtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlVirtualMachineName { get => this._sqlVirtualMachineName; set => this._sqlVirtualMachineName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlVirtualMachineName = this.SqlVirtualMachineName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_Cutover() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlVMCutover(ResourceGroupName, SqlVirtualMachineName, TargetDbName, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlVirtualMachineName=SqlVirtualMachineName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlVirtualMachineName=SqlVirtualMachineName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded.cs new file mode 100644 index 000000000000..e5cb0b4bbf3e --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Initiate cutover for in-progress online database migration to SQL VM. + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlVirtualMachineName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlVirtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlVirtualMachineName { get => this._sqlVirtualMachineName; set => this._sqlVirtualMachineName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlVirtualMachineName = this.SqlVirtualMachineName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlVMCutover(ResourceGroupName, SqlVirtualMachineName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlVirtualMachineName=SqlVirtualMachineName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlVirtualMachineName=SqlVirtualMachineName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity.cs new file mode 100644 index 000000000000..143952289676 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity.cs @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Initiate cutover for in-progress online database migration to SQL VM. + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlVMCutoverViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlVirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlVirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlVMCutover(InputObject.ResourceGroupName ?? null, InputObject.SqlVirtualMachineName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded.cs new file mode 100644 index 000000000000..33316db358ff --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Initiate cutover for in-progress online database migration to SQL VM. + /// + /// [OpenAPI] Cutover=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Initiate cutover for in-progress online database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded Clone() + { + var clone = new InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataMigrationCutoverDatabaseMigrationSqlVM_CutoverViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCutover' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlVMCutoverViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlVirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlVirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlVMCutover(InputObject.ResourceGroupName ?? null, InputObject.SqlVirtualMachineName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded.cs new file mode 100644 index 000000000000..76b177a022ea --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded.cs @@ -0,0 +1,706 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Create or Update Database Migration resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationDatabaseMigrationSqlDb_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Create or Update Database Migration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get => ParametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType)""); set => ParametersBody.Kind = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking current migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking current migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// Resource Id of the Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + public string MigrationService { get => ParametersBody.MigrationService ?? null; set => ParametersBody.MigrationService = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlDb(); + + /// Database Migration Resource for SQL Database. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Error message for migration provisioning failure, if any. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Error message for migration provisioning failure, if any.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + public string ProvisioningError { get => ParametersBody.ProvisioningError ?? null; set => ParametersBody.ProvisioningError = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the target resource (SQL VM or SQL Managed Instance).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + public string Scope { get => ParametersBody.Scope ?? null; set => ParametersBody.Scope = value; } + + /// Name of the source database. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the source database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + public string SourceDatabaseName { get => ParametersBody.SourceDatabaseName ?? null; set => ParametersBody.SourceDatabaseName = value; } + + /// Authentication type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authentication type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionAuthentication { get => ParametersBody.SourceSqlConnectionAuthentication ?? null; set => ParametersBody.SourceSqlConnectionAuthentication = value; } + + /// Data source. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Data source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionDataSource { get => ParametersBody.SourceSqlConnectionDataSource ?? null; set => ParametersBody.SourceSqlConnectionDataSource = value; } + + /// Whether to encrypt connection or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to encrypt connection or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SourceSqlConnectionEncryptConnection { get => ParametersBody.SourceSqlConnectionEncryptConnection ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.SourceSqlConnectionEncryptConnection = value; } + + /// Password to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + public System.Security.SecureString SourceSqlConnectionPassword { get => ParametersBody.SourceSqlConnectionPassword ?? null; set => ParametersBody.SourceSqlConnectionPassword = value; } + + /// Whether to trust server certificate or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to trust server certificate or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SourceSqlConnectionTrustServerCertificate { get => ParametersBody.SourceSqlConnectionTrustServerCertificate ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.SourceSqlConnectionTrustServerCertificate = value; } + + /// User name to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionUserName { get => ParametersBody.SourceSqlConnectionUserName ?? null; set => ParametersBody.SourceSqlConnectionUserName = value; } + + /// Backing field for property. + private string _sqlDbInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlDbInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlDbInstanceName { get => this._sqlDbInstanceName; set => this._sqlDbInstanceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// List of tables to copy. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of tables to copy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tables to copy.", + SerializedName = @"tableList", + PossibleTypes = new [] { typeof(string) })] + public string[] TableList { get => ParametersBody.TableList ?? null /* arrayOf */; set => ParametersBody.TableList = value; } + + /// Database collation to be used for the target database. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Database collation to be used for the target database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + public string TargetDatabaseCollation { get => ParametersBody.TargetDatabaseCollation ?? null; set => ParametersBody.TargetDatabaseCollation = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// Authentication type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authentication type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + public string TargetSqlConnectionAuthentication { get => ParametersBody.TargetSqlConnectionAuthentication ?? null; set => ParametersBody.TargetSqlConnectionAuthentication = value; } + + /// Data source. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Data source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + public string TargetSqlConnectionDataSource { get => ParametersBody.TargetSqlConnectionDataSource ?? null; set => ParametersBody.TargetSqlConnectionDataSource = value; } + + /// Whether to encrypt connection or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to encrypt connection or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter TargetSqlConnectionEncryptConnection { get => ParametersBody.TargetSqlConnectionEncryptConnection ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.TargetSqlConnectionEncryptConnection = value; } + + /// Password to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + public System.Security.SecureString TargetSqlConnectionPassword { get => ParametersBody.TargetSqlConnectionPassword ?? null; set => ParametersBody.TargetSqlConnectionPassword = value; } + + /// Whether to trust server certificate or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to trust server certificate or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter TargetSqlConnectionTrustServerCertificate { get => ParametersBody.TargetSqlConnectionTrustServerCertificate ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.TargetSqlConnectionTrustServerCertificate = value; } + + /// User name to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string TargetSqlConnectionUserName { get => ParametersBody.TargetSqlConnectionUserName ?? null; set => ParametersBody.TargetSqlConnectionUserName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded Clone() + { + var clone = new NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlDbInstanceName = this.SqlDbInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationDatabaseMigrationSqlDb_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlDbCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlDbCreateOrUpdate(ResourceGroupName, SqlDbInstanceName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlDbInstanceName=SqlDbInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlDbInstanceName=SqlDbInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlDb + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded.cs new file mode 100644 index 000000000000..f4e5092c838c --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded.cs @@ -0,0 +1,741 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Create a new database migration to a given SQL Managed Instance. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationDatabaseMigrationSqlMi_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Create a new database migration to a given SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Storage Account Key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage Account Key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + public string AzureBlobAccountKey { get => ParametersBody.AzureBlobAccountKey ?? null; set => ParametersBody.AzureBlobAccountKey = value; } + + /// Blob container name where backups are stored. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Blob container name where backups are stored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + public string AzureBlobContainerName { get => ParametersBody.AzureBlobContainerName ?? null; set => ParametersBody.AzureBlobContainerName = value; } + + /// Resource Id of the storage account where backups are stored. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the storage account where backups are stored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + public string AzureBlobStorageAccountResourceId { get => ParametersBody.AzureBlobStorageAccountResourceId ?? null; set => ParametersBody.AzureBlobStorageAccountResourceId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Password for username to access file share location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password for username to access file share location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + public System.Security.SecureString FileSharePassword { get => ParametersBody.FileSharePassword ?? null; set => ParametersBody.FileSharePassword = value; } + + /// Location as SMB share or local drive where backups are placed. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Location as SMB share or local drive where backups are placed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + public string FileSharePath { get => ParametersBody.FileSharePath ?? null; set => ParametersBody.FileSharePath = value; } + + /// Username to access the file share location for backups. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Username to access the file share location for backups.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + public string FileShareUsername { get => ParametersBody.FileShareUsername ?? null; set => ParametersBody.FileShareUsername = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get => ParametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType)""); set => ParametersBody.Kind = value; } + + /// Backing field for property. + private string _managedInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"managedInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ManagedInstanceName { get => this._managedInstanceName; set => this._managedInstanceName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking current migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking current migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// Resource Id of the Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + public string MigrationService { get => ParametersBody.MigrationService ?? null; set => ParametersBody.MigrationService = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"lastBackupName", + PossibleTypes = new [] { typeof(string) })] + public string OfflineConfigurationLastBackupName { get => ParametersBody.OfflineConfigurationLastBackupName ?? null; set => ParametersBody.OfflineConfigurationLastBackupName = value; } + + /// Offline migration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Offline migration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter OfflineConfigurationOffline { get => ParametersBody.OfflineConfigurationOffline ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.OfflineConfigurationOffline = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlMi(); + + /// Database Migration Resource for SQL Managed Instance. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Error message for migration provisioning failure, if any. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Error message for migration provisioning failure, if any.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + public string ProvisioningError { get => ParametersBody.ProvisioningError ?? null; set => ParametersBody.ProvisioningError = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the target resource (SQL VM or SQL Managed Instance).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + public string Scope { get => ParametersBody.Scope ?? null; set => ParametersBody.Scope = value; } + + /// Name of the source database. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the source database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + public string SourceDatabaseName { get => ParametersBody.SourceDatabaseName ?? null; set => ParametersBody.SourceDatabaseName = value; } + + /// Authentication type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authentication type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionAuthentication { get => ParametersBody.SourceSqlConnectionAuthentication ?? null; set => ParametersBody.SourceSqlConnectionAuthentication = value; } + + /// Data source. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Data source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionDataSource { get => ParametersBody.SourceSqlConnectionDataSource ?? null; set => ParametersBody.SourceSqlConnectionDataSource = value; } + + /// Whether to encrypt connection or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to encrypt connection or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SourceSqlConnectionEncryptConnection { get => ParametersBody.SourceSqlConnectionEncryptConnection ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.SourceSqlConnectionEncryptConnection = value; } + + /// Password to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + public System.Security.SecureString SourceSqlConnectionPassword { get => ParametersBody.SourceSqlConnectionPassword ?? null; set => ParametersBody.SourceSqlConnectionPassword = value; } + + /// Whether to trust server certificate or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to trust server certificate or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SourceSqlConnectionTrustServerCertificate { get => ParametersBody.SourceSqlConnectionTrustServerCertificate ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.SourceSqlConnectionTrustServerCertificate = value; } + + /// User name to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionUserName { get => ParametersBody.SourceSqlConnectionUserName ?? null; set => ParametersBody.SourceSqlConnectionUserName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Database collation to be used for the target database. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Database collation to be used for the target database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + public string TargetDatabaseCollation { get => ParametersBody.TargetDatabaseCollation ?? null; set => ParametersBody.TargetDatabaseCollation = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// Storage Account Key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage Account Key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + public string TargetLocationAccountKey { get => ParametersBody.TargetLocationAccountKey ?? null; set => ParametersBody.TargetLocationAccountKey = value; } + + /// Resource Id of the storage account copying backups. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the storage account copying backups.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetLocationStorageAccountResourceId { get => ParametersBody.TargetLocationStorageAccountResourceId ?? null; set => ParametersBody.TargetLocationStorageAccountResourceId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded Clone() + { + var clone = new NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagedInstanceName = this.ManagedInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationDatabaseMigrationSqlMi_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlMiCreateOrUpdate(ResourceGroupName, ManagedInstanceName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ManagedInstanceName=ManagedInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ManagedInstanceName=ManagedInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlMi + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded.cs new file mode 100644 index 000000000000..7f01f147fd4d --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded.cs @@ -0,0 +1,741 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Create a new database migration to a given SQL VM. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationDatabaseMigrationSqlVM_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Create a new database migration to a given SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Storage Account Key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage Account Key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + public string AzureBlobAccountKey { get => ParametersBody.AzureBlobAccountKey ?? null; set => ParametersBody.AzureBlobAccountKey = value; } + + /// Blob container name where backups are stored. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Blob container name where backups are stored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob container name where backups are stored.", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + public string AzureBlobContainerName { get => ParametersBody.AzureBlobContainerName ?? null; set => ParametersBody.AzureBlobContainerName = value; } + + /// Resource Id of the storage account where backups are stored. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the storage account where backups are stored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account where backups are stored.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + public string AzureBlobStorageAccountResourceId { get => ParametersBody.AzureBlobStorageAccountResourceId ?? null; set => ParametersBody.AzureBlobStorageAccountResourceId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Password for username to access file share location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password for username to access file share location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for username to access file share location.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + public System.Security.SecureString FileSharePassword { get => ParametersBody.FileSharePassword ?? null; set => ParametersBody.FileSharePassword = value; } + + /// Location as SMB share or local drive where backups are placed. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Location as SMB share or local drive where backups are placed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location as SMB share or local drive where backups are placed.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + public string FileSharePath { get => ParametersBody.FileSharePath ?? null; set => ParametersBody.FileSharePath = value; } + + /// Username to access the file share location for backups. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Username to access the file share location for backups.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to access the file share location for backups.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + public string FileShareUsername { get => ParametersBody.FileShareUsername ?? null; set => ParametersBody.FileShareUsername = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType Kind { get => ParametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ResourceType)""); set => ParametersBody.Kind = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking current migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking current migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking current migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// Resource Id of the Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the Migration Service.", + SerializedName = @"migrationService", + PossibleTypes = new [] { typeof(string) })] + public string MigrationService { get => ParametersBody.MigrationService ?? null; set => ParametersBody.MigrationService = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"lastBackupName", + PossibleTypes = new [] { typeof(string) })] + public string OfflineConfigurationLastBackupName { get => ParametersBody.OfflineConfigurationLastBackupName ?? null; set => ParametersBody.OfflineConfigurationLastBackupName = value; } + + /// Offline migration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Offline migration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Offline migration", + SerializedName = @"offline", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter OfflineConfigurationOffline { get => ParametersBody.OfflineConfigurationOffline ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.OfflineConfigurationOffline = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DatabaseMigrationSqlVM(); + + /// Database Migration Resource for SQL Virtual Machine. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Error message for migration provisioning failure, if any. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Error message for migration provisioning failure, if any.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message for migration provisioning failure, if any.", + SerializedName = @"provisioningError", + PossibleTypes = new [] { typeof(string) })] + public string ProvisioningError { get => ParametersBody.ProvisioningError ?? null; set => ParametersBody.ProvisioningError = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Resource Id of the target resource (SQL VM or SQL Managed Instance). + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the target resource (SQL VM or SQL Managed Instance).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the target resource (SQL VM or SQL Managed Instance).", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + public string Scope { get => ParametersBody.Scope ?? null; set => ParametersBody.Scope = value; } + + /// Name of the source database. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the source database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source database.", + SerializedName = @"sourceDatabaseName", + PossibleTypes = new [] { typeof(string) })] + public string SourceDatabaseName { get => ParametersBody.SourceDatabaseName ?? null; set => ParametersBody.SourceDatabaseName = value; } + + /// Authentication type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authentication type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication type.", + SerializedName = @"authentication", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionAuthentication { get => ParametersBody.SourceSqlConnectionAuthentication ?? null; set => ParametersBody.SourceSqlConnectionAuthentication = value; } + + /// Data source. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Data source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data source.", + SerializedName = @"dataSource", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionDataSource { get => ParametersBody.SourceSqlConnectionDataSource ?? null; set => ParametersBody.SourceSqlConnectionDataSource = value; } + + /// Whether to encrypt connection or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to encrypt connection or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to encrypt connection or not.", + SerializedName = @"encryptConnection", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SourceSqlConnectionEncryptConnection { get => ParametersBody.SourceSqlConnectionEncryptConnection ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.SourceSqlConnectionEncryptConnection = value; } + + /// Password to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to source SQL.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + public System.Security.SecureString SourceSqlConnectionPassword { get => ParametersBody.SourceSqlConnectionPassword ?? null; set => ParametersBody.SourceSqlConnectionPassword = value; } + + /// Whether to trust server certificate or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to trust server certificate or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to trust server certificate or not.", + SerializedName = @"trustServerCertificate", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SourceSqlConnectionTrustServerCertificate { get => ParametersBody.SourceSqlConnectionTrustServerCertificate ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.SourceSqlConnectionTrustServerCertificate = value; } + + /// User name to connect to source SQL. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name to connect to source SQL.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name to connect to source SQL.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string SourceSqlConnectionUserName { get => ParametersBody.SourceSqlConnectionUserName ?? null; set => ParametersBody.SourceSqlConnectionUserName = value; } + + /// Backing field for property. + private string _sqlVirtualMachineName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlVirtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlVirtualMachineName { get => this._sqlVirtualMachineName; set => this._sqlVirtualMachineName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Database collation to be used for the target database. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Database collation to be used for the target database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database collation to be used for the target database.", + SerializedName = @"targetDatabaseCollation", + PossibleTypes = new [] { typeof(string) })] + public string TargetDatabaseCollation { get => ParametersBody.TargetDatabaseCollation ?? null; set => ParametersBody.TargetDatabaseCollation = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// Storage Account Key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage Account Key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Key.", + SerializedName = @"accountKey", + PossibleTypes = new [] { typeof(string) })] + public string TargetLocationAccountKey { get => ParametersBody.TargetLocationAccountKey ?? null; set => ParametersBody.TargetLocationAccountKey = value; } + + /// Resource Id of the storage account copying backups. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the storage account copying backups.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the storage account copying backups.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetLocationStorageAccountResourceId { get => ParametersBody.TargetLocationStorageAccountResourceId ?? null; set => ParametersBody.TargetLocationStorageAccountResourceId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded Clone() + { + var clone = new NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlVirtualMachineName = this.SqlVirtualMachineName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationDatabaseMigrationSqlVM_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlVMCreateOrUpdate(ResourceGroupName, SqlVirtualMachineName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlVirtualMachineName=SqlVirtualMachineName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlVirtualMachineName=SqlVirtualMachineName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseMigrationSqlVM + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationFile_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationFile_CreateExpanded.cs new file mode 100644 index 000000000000..41016d8a89f6 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationFile_CreateExpanded.cs @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// The PUT method creates a new file or updates an existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationFile_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The PUT method creates a new file or updates an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationFile_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.", + SerializedName = @"extension", + PossibleTypes = new [] { typeof(string) })] + public string Extension { get => ParametersBody.Extension ?? null; set => ParametersBody.Extension = value; } + + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Relative path of this file resource. This property can be set when creating or updating the file resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative path of this file resource. This property can be set when creating or updating the file resource.", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + public string FilePath { get => ParametersBody.FilePath ?? null; set => ParametersBody.FilePath = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// File content type. This property can be modified to reflect the file content type. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "File content type. This property can be modified to reflect the file content type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File content type. This property can be modified to reflect the file content type.", + SerializedName = @"mediaType", + PossibleTypes = new [] { typeof(string) })] + public string MediaType { get => ParametersBody.MediaType ?? null; set => ParametersBody.MediaType = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the File + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the File")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the File", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile(); + + /// A file resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationFile_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesCreateOrUpdate(SubscriptionId, GroupName, ServiceName, ProjectName, Name, ParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationProject_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationProject_CreateExpanded.cs new file mode 100644 index 000000000000..ad97a7213752 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationProject_CreateExpanded.cs @@ -0,0 +1,643 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. The PUT method creates a new project + /// or updates an existing one. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationProject_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationProject_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Key used to authenticate to the Azure Active Directory Application + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key used to authenticate to the Azure Active Directory Application")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoAppKey { get => ParametersBody.AzureAuthenticationInfoAppKey ?? null; set => ParametersBody.AzureAuthenticationInfoAppKey = value; } + + /// Application ID of the Azure Active Directory Application + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Application ID of the Azure Active Directory Application")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoApplicationId { get => ParametersBody.AzureAuthenticationInfoApplicationId ?? null; set => ParametersBody.AzureAuthenticationInfoApplicationId = value; } + + /// Ignore checking azure permissions on the AAD app + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ignore checking azure permissions on the AAD app")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AzureAuthenticationInfoIgnoreAzurePermission { get => ParametersBody.AzureAuthenticationInfoIgnoreAzurePermission ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.AzureAuthenticationInfoIgnoreAzurePermission = value; } + + /// Tenant id of the customer + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tenant id of the customer")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoTenantId { get => ParametersBody.AzureAuthenticationInfoTenantId ?? null; set => ParametersBody.AzureAuthenticationInfoTenantId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// List of DatabaseInfo + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of DatabaseInfo")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of DatabaseInfo", + SerializedName = @"databasesInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get => ParametersBody.DatabasesInfo ?? null /* arrayOf */; set => ParametersBody.DatabasesInfo = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location ?? null; set => ParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ProjectName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project(); + + /// A project resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Password credential. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoPassword { get => ParametersBody.SourceConnectionInfoPassword ?? null; set => ParametersBody.SourceConnectionInfoPassword = value; } + + /// Type of connection info + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of connection info")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoType { get => ParametersBody.SourceConnectionInfoType ?? null; set => ParametersBody.SourceConnectionInfoType = value; } + + /// User name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoUserName { get => ParametersBody.SourceConnectionInfoUserName ?? null; set => ParametersBody.SourceConnectionInfoUserName = value; } + + /// Source platform for the project + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source platform for the project")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source platform for the project", + SerializedName = @"sourcePlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform SourcePlatform { get => ParametersBody.SourcePlatform ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform)""); set => ParametersBody.SourcePlatform = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// Password credential. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoPassword { get => ParametersBody.TargetConnectionInfoPassword ?? null; set => ParametersBody.TargetConnectionInfoPassword = value; } + + /// Type of connection info + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of connection info")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoType { get => ParametersBody.TargetConnectionInfoType ?? null; set => ParametersBody.TargetConnectionInfoType = value; } + + /// User name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoUserName { get => ParametersBody.TargetConnectionInfoUserName ?? null; set => ParametersBody.TargetConnectionInfoUserName = value; } + + /// Target platform for the project + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Target platform for the project")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target platform for the project", + SerializedName = @"targetPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform TargetPlatform { get => ParametersBody.TargetPlatform ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform)""); set => ParametersBody.TargetPlatform = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationProject_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ProjectsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ProjectsCreateOrUpdate(SubscriptionId, GroupName, ServiceName, Name, ParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationServiceTask_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationServiceTask_CreateExpanded.cs new file mode 100644 index 000000000000..6c006d48dd1b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationServiceTask_CreateExpanded.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + /// creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, + /// there is little reason to update an existing one. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationServiceTask_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new service task or updates an existing one, although since service tasks have no mutable custom properties, there is little reason to update an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationServiceTask_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Key value pairs of client data to attach meta data information to task + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key value pairs of client data to attach meta data information to task")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ParametersBody.ClientData ?? null /* object */; set => ParametersBody.ClientData = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask(); + + /// A task resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// Task type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Task type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ParametersBody.TaskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType)""); set => ParametersBody.TaskType = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationServiceTask_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServiceTasksCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServiceTasksCreateOrUpdate(SubscriptionId, GroupName, ServiceName, TaskName, ParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,TaskName=TaskName,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationService_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationService_CreateExpanded.cs new file mode 100644 index 000000000000..37eaeabe8850 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationService_CreateExpanded.cs @@ -0,0 +1,651 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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 (\"ServiceIsBusy\"). The provider will reply when successful + /// with 200 OK or 201 Created. Long-running operations use the provisioningState property. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationService_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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 (\""ServiceIsBusy\""). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationService_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The time delay before the service is auto-stopped when idle. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time delay before the service is auto-stopped when idle.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time delay before the service is auto-stopped when idle.", + SerializedName = @"autoStopDelay", + PossibleTypes = new [] { typeof(string) })] + public string AutoStopDelay { get => ParametersBody.AutoStopDelay ?? null; set => ParametersBody.AutoStopDelay = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether service resources should be deleted when stopped. (Turned on by default)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether service resources should be deleted when stopped. (Turned on by default)", + SerializedName = @"deleteResourcesOnStop", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DeleteResourcesOnStop { get => ParametersBody.DeleteResourcesOnStop ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.DeleteResourcesOnStop = value; } + + /// HTTP strong entity tag value. Ignored if submitted + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. Ignored if submitted")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. Ignored if submitted", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The resource kind. Only 'vm' (the default) is supported. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource kind. Only 'vm' (the default) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource kind. Only 'vm' (the default) is supported.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + public string Kind { get => ParametersBody.Kind ?? null; set => ParametersBody.Kind = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location ?? null; set => ParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService(); + + /// A Database Migration Service resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The public key of the service, used to encrypt secrets sent to the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The public key of the service, used to encrypt secrets sent to the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The public key of the service, used to encrypt secrets sent to the service", + SerializedName = @"publicKey", + PossibleTypes = new [] { typeof(string) })] + public string PublicKey { get => ParametersBody.PublicKey ?? null; set => ParametersBody.PublicKey = value; } + + /// The capacity of the SKU, if it supports scaling + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The capacity of the SKU, if it supports scaling")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity of the SKU, if it supports scaling", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + public int SkuCapacity { get => ParametersBody.SkuCapacity ?? default(int); set => ParametersBody.SkuCapacity = value; } + + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + public string SkuFamily { get => ParametersBody.SkuFamily ?? null; set => ParametersBody.SkuFamily = value; } + + /// The unique name of the SKU, such as 'P3' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique name of the SKU, such as 'P3'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique name of the SKU, such as 'P3'", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string SkuName { get => ParametersBody.SkuName ?? null; set => ParametersBody.SkuName = value; } + + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + public string SkuSize { get => ParametersBody.SkuSize ?? null; set => ParametersBody.SkuSize = value; } + + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + public string SkuTier { get => ParametersBody.SkuTier ?? null; set => ParametersBody.SkuTier = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Microsoft.Network/networkInterfaces resource which the service have")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/networkInterfaces resource which the service have", + SerializedName = @"virtualNicId", + PossibleTypes = new [] { typeof(string) })] + public string VirtualNicId { get => ParametersBody.VirtualNicId ?? null; set => ParametersBody.VirtualNicId = value; } + + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined", + SerializedName = @"virtualSubnetId", + PossibleTypes = new [] { typeof(string) })] + public string VirtualSubnetId { get => ParametersBody.VirtualSubnetId ?? null; set => ParametersBody.VirtualSubnetId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataMigrationService_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.NewAzDataMigrationService_CreateExpanded Clone() + { + var clone = new NewAzDataMigrationService_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.GroupName = this.GroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationService_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesCreateOrUpdate(SubscriptionId, GroupName, Name, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_Regenerate.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_Regenerate.cs new file mode 100644 index 000000000000..08229deee9b2 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_Regenerate.cs @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + /// + /// + /// [OpenAPI] RegenerateAuthKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationSqlMigrationServiceAuthKey_Regenerate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationSqlMigrationServiceAuthKey_Regenerate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys _parameter; + + /// An authentication key to regenerate. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An authentication key to regenerate.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An authentication key to regenerate.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationSqlMigrationServiceAuthKey_Regenerate() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesRegenerateAuthKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesRegenerateAuthKeys(ResourceGroupName, SqlMigrationServiceName, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlMigrationServiceName=SqlMigrationServiceName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlMigrationServiceName=SqlMigrationServiceName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded.cs new file mode 100644 index 000000000000..a14659da22d2 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + /// + /// + /// [OpenAPI] RegenerateAuthKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The first authentication key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The first authentication key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The first authentication key.", + SerializedName = @"authKey1", + PossibleTypes = new [] { typeof(string) })] + public string AuthKey1 { get => ParametersBody.AuthKey1 ?? null; set => ParametersBody.AuthKey1 = value; } + + /// The second authentication key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The second authentication key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The second authentication key.", + SerializedName = @"authKey2", + PossibleTypes = new [] { typeof(string) })] + public string AuthKey2 { get => ParametersBody.AuthKey2 ?? null; set => ParametersBody.AuthKey2 = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The name of authentication key to generate. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of authentication key to generate.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of authentication key to generate.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => ParametersBody.KeyName ?? null; set => ParametersBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.RegenAuthKeys(); + + /// An authentication key to regenerate. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesRegenerateAuthKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesRegenerateAuthKeys(ResourceGroupName, SqlMigrationServiceName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlMigrationServiceName=SqlMigrationServiceName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlMigrationServiceName=SqlMigrationServiceName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..8d39f67a3fba --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + /// + /// + /// [OpenAPI] RegenerateAuthKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys _parameter; + + /// An authentication key to regenerate. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An authentication key to regenerate.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An authentication key to regenerate.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentity() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesRegenerateAuthKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SqlMigrationServicesRegenerateAuthKeysViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlMigrationServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlMigrationServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SqlMigrationServicesRegenerateAuthKeys(InputObject.ResourceGroupName ?? null, InputObject.SqlMigrationServiceName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded.cs new file mode 100644 index 000000000000..70c8cc74bc41 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + /// + /// + /// [OpenAPI] RegenerateAuthKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The first authentication key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The first authentication key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The first authentication key.", + SerializedName = @"authKey1", + PossibleTypes = new [] { typeof(string) })] + public string AuthKey1 { get => ParametersBody.AuthKey1 ?? null; set => ParametersBody.AuthKey1 = value; } + + /// The second authentication key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The second authentication key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The second authentication key.", + SerializedName = @"authKey2", + PossibleTypes = new [] { typeof(string) })] + public string AuthKey2 { get => ParametersBody.AuthKey2 ?? null; set => ParametersBody.AuthKey2 = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The name of authentication key to generate. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of authentication key to generate.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of authentication key to generate.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => ParametersBody.KeyName ?? null; set => ParametersBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.RegenAuthKeys(); + + /// An authentication key to regenerate. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationSqlMigrationServiceAuthKey_RegenerateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesRegenerateAuthKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SqlMigrationServicesRegenerateAuthKeysViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlMigrationServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlMigrationServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SqlMigrationServicesRegenerateAuthKeys(InputObject.ResourceGroupName ?? null, InputObject.SqlMigrationServiceName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IRegenAuthKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationService_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationService_CreateExpanded.cs new file mode 100644 index 000000000000..94976499cded --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationSqlMigrationService_CreateExpanded.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Create or Update Database Migration Service. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationSqlMigrationService_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Create or Update Database Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationSqlMigrationService_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location ?? null; set => ParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SqlMigrationServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationService(); + + /// A SQL Migration Service. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataMigrationSqlMigrationService_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.NewAzDataMigrationSqlMigrationService_CreateExpanded Clone() + { + var clone = new NewAzDataMigrationSqlMigrationService_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationSqlMigrationService_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesCreateOrUpdate(ResourceGroupName, Name, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,Name=Name,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationTask_CreateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationTask_CreateExpanded.cs new file mode 100644 index 000000000000..a377925f13cb --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/NewAzDataMigrationTask_CreateExpanded.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataMigrationTask_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class NewAzDataMigrationTask_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Key value pairs of client data to attach meta data information to task + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key value pairs of client data to attach meta data information to task")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ParametersBody.ClientData ?? null /* object */; set => ParametersBody.ClientData = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TaskName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask(); + + /// A task resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Task type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Task type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ParametersBody.TaskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType)""); set => ParametersBody.TaskType = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzDataMigrationTask_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksCreateOrUpdate(SubscriptionId, GroupName, ServiceName, ProjectName, Name, ParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFileWrite_Read.cs b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFileWrite_Read.cs new file mode 100644 index 000000000000..23a35dca6756 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFileWrite_Read.cs @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method is used for requesting information for reading and writing the file content. + /// + /// + /// [OpenAPI] ReadWrite=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Read, @"AzDataMigrationFileWrite_Read", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method is used for requesting information for reading and writing the file content.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class ReadAzDataMigrationFileWrite_Read : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _fileName; + + /// Name of the File + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the File")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the File", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string FileName { get => this._fileName; set => this._fileName = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesReadWrite' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesReadWrite(SubscriptionId, GroupName, ServiceName, ProjectName, FileName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,FileName=FileName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ReadAzDataMigrationFileWrite_Read() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, FileName=FileName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, FileName=FileName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFileWrite_ReadViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFileWrite_ReadViaIdentity.cs new file mode 100644 index 000000000000..ae0e1dabaa11 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFileWrite_ReadViaIdentity.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method is used for requesting information for reading and writing the file content. + /// + /// + /// [OpenAPI] ReadWrite=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Read, @"AzDataMigrationFileWrite_ReadViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method is used for requesting information for reading and writing the file content.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class ReadAzDataMigrationFileWrite_ReadViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesReadWrite' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FilesReadWriteViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FilesReadWrite(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.FileName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ReadAzDataMigrationFileWrite_ReadViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFile_Read.cs b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFile_Read.cs new file mode 100644 index 000000000000..1853b4206355 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFile_Read.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method is used for requesting storage information using which contents of the file can be downloaded. + /// + /// + /// [OpenAPI] Read=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Read, @"AzDataMigrationFile_Read", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method is used for requesting storage information using which contents of the file can be downloaded.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class ReadAzDataMigrationFile_Read : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the File + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the File")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the File", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesRead' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesRead(SubscriptionId, GroupName, ServiceName, ProjectName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ReadAzDataMigrationFile_Read() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFile_ReadViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFile_ReadViaIdentity.cs new file mode 100644 index 000000000000..1d20e89f52c1 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/ReadAzDataMigrationFile_ReadViaIdentity.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method is used for requesting storage information using which contents of the file can be downloaded. + /// + /// + /// [OpenAPI] Read=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Read, @"AzDataMigrationFile_ReadViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method is used for requesting storage information using which contents of the file can be downloaded.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class ReadAzDataMigrationFile_ReadViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesRead' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FilesReadViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FilesRead(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.FileName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ReadAzDataMigrationFile_ReadViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IFileStorageInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete.cs new file mode 100644 index 000000000000..8c819023f1e9 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete Database Migration resource. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationDatabaseMigrationsSqlDb_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete Database Migration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _force; + + /// + /// Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional force delete boolean. If this is provided as true, migration will be deleted even if active.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional force delete boolean. If this is provided as true, migration will be deleted even if active.", + SerializedName = @"force", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter Force { get => this._force; set => this._force = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlDbInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlDbInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlDbInstanceName { get => this._sqlDbInstanceName; set => this._sqlDbInstanceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete Clone() + { + var clone = new RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlDbInstanceName = this.SqlDbInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.Force = this.Force; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlDbDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlDbDelete(ResourceGroupName, SqlDbInstanceName, TargetDbName, this.InvocationInformation.BoundParameters.ContainsKey("Force") ? Force : default(global::System.Management.Automation.SwitchParameter?), SubscriptionId, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlDbInstanceName=SqlDbInstanceName,TargetDbName=TargetDbName,Force=this.InvocationInformation.BoundParameters.ContainsKey("Force") ? Force : default(global::System.Management.Automation.SwitchParameter?),SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationDatabaseMigrationsSqlDb_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlDbInstanceName=SqlDbInstanceName, TargetDbName=TargetDbName, Force=this.InvocationInformation.BoundParameters.ContainsKey("Force") ? Force : default(global::System.Management.Automation.SwitchParameter?), SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity.cs new file mode 100644 index 000000000000..965cd6d04c59 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete Database Migration resource. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete Database Migration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _force; + + /// + /// Optional force delete boolean. If this is provided as true, migration will be deleted even if active. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional force delete boolean. If this is provided as true, migration will be deleted even if active.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional force delete boolean. If this is provided as true, migration will be deleted even if active.", + SerializedName = @"force", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter Force { get => this._force; set => this._force = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Force = this.Force; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlDbDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlDbDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Force") ? Force : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlDbInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlDbInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlDbDelete(InputObject.ResourceGroupName ?? null, InputObject.SqlDbInstanceName ?? null, InputObject.TargetDbName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Force") ? Force : default(global::System.Management.Automation.SwitchParameter?), InputObject.SubscriptionId ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Force=this.InvocationInformation.BoundParameters.ContainsKey("Force") ? Force : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzDataMigrationDatabaseMigrationsSqlDb_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Force=this.InvocationInformation.BoundParameters.ContainsKey("Force") ? Force : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationFile_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationFile_Delete.cs new file mode 100644 index 000000000000..ec3223b3190b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationFile_Delete.cs @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// This method deletes a file. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationFile_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method deletes a file.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationFile_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the File + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the File")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the File", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesDelete(SubscriptionId, GroupName, ServiceName, ProjectName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationFile_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationFile_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationFile_DeleteViaIdentity.cs new file mode 100644 index 000000000000..d8b91a208875 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationFile_DeleteViaIdentity.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// This method deletes a file. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationFile_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method deletes a file.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationFile_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FilesDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FilesDelete(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.FileName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationFile_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationProject_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationProject_Delete.cs new file mode 100644 index 000000000000..b27f12076567 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationProject_Delete.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationProject_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationProject_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ProjectName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ProjectsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ProjectsDelete(SubscriptionId, GroupName, ServiceName, Name, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,Name=Name,DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationProject_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationProject_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationProject_DeleteViaIdentity.cs new file mode 100644 index 000000000000..86a9d7b09ce1 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationProject_DeleteViaIdentity.cs @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationProject_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationProject_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ProjectsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ProjectsDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ProjectsDelete(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationProject_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationServiceTask_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationServiceTask_Delete.cs new file mode 100644 index 000000000000..73c0120d5f56 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationServiceTask_Delete.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + /// method deletes a service task, canceling it first if it's running. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationServiceTask_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a service task, canceling it first if it's running.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationServiceTask_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServiceTasksDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServiceTasksDelete(SubscriptionId, GroupName, ServiceName, TaskName, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,TaskName=TaskName,DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationServiceTask_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationServiceTask_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationServiceTask_DeleteViaIdentity.cs new file mode 100644 index 000000000000..b73bb98c3092 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationServiceTask_DeleteViaIdentity.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + /// method deletes a service task, canceling it first if it's running. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationServiceTask_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a service task, canceling it first if it's running.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationServiceTask_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServiceTasksDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServiceTasksDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServiceTasksDelete(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.TaskName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationServiceTask_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationService_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationService_Delete.cs new file mode 100644 index 000000000000..aaa91adccfb8 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationService_Delete.cs @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationService_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationService_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataMigrationService_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.RemoveAzDataMigrationService_Delete Clone() + { + var clone = new RemoveAzDataMigrationService_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.GroupName = this.GroupName; + clone.Name = this.Name; + clone.DeleteRunningTask = this.DeleteRunningTask; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesDelete(SubscriptionId, GroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,Name=Name,DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationService_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationService_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationService_DeleteViaIdentity.cs new file mode 100644 index 000000000000..17e4e16eee44 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationService_DeleteViaIdentity.cs @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationService_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationService_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataMigrationService_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.RemoveAzDataMigrationService_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataMigrationService_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeleteRunningTask = this.DeleteRunningTask; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesDelete(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationService_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_Delete.cs new file mode 100644 index 000000000000..862a5449c32a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_Delete.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete the integration runtime node. + /// + /// [OpenAPI] DeleteNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationSqlMigrationServiceNode_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete the integration runtime node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationSqlMigrationServiceNode_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode _parameter; + + /// Details of node to be deleted. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Details of node to be deleted.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Details of node to be deleted.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesDeleteNode' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesDeleteNode(ResourceGroupName, SqlMigrationServiceName, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlMigrationServiceName=SqlMigrationServiceName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationSqlMigrationServiceNode_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlMigrationServiceName=SqlMigrationServiceName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteExpanded.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteExpanded.cs new file mode 100644 index 000000000000..763d120680a4 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteExpanded.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete the integration runtime node. + /// + /// [OpenAPI] DeleteNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationSqlMigrationServiceNode_DeleteExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete the integration runtime node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationSqlMigrationServiceNode_DeleteExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The name of integration runtime. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of integration runtime.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of integration runtime.", + SerializedName = @"integrationRuntimeName", + PossibleTypes = new [] { typeof(string) })] + public string IntegrationRuntimeName { get => ParametersBody.IntegrationRuntimeName ?? null; set => ParametersBody.IntegrationRuntimeName = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The name of node to delete. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of node to delete.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of node to delete.", + SerializedName = @"nodeName", + PossibleTypes = new [] { typeof(string) })] + public string NodeName { get => ParametersBody.NodeName ?? null; set => ParametersBody.NodeName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DeleteNode(); + + /// Details of node to be deleted. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlMigrationServiceName; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlMigrationServiceName { get => this._sqlMigrationServiceName; set => this._sqlMigrationServiceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesDeleteNode' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesDeleteNode(ResourceGroupName, SqlMigrationServiceName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlMigrationServiceName=SqlMigrationServiceName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationSqlMigrationServiceNode_DeleteExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlMigrationServiceName=SqlMigrationServiceName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity.cs new file mode 100644 index 000000000000..a3796dce1387 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete the integration runtime node. + /// + /// [OpenAPI] DeleteNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete the integration runtime node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode _parameter; + + /// Details of node to be deleted. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Details of node to be deleted.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Details of node to be deleted.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesDeleteNode' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SqlMigrationServicesDeleteNodeViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlMigrationServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlMigrationServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SqlMigrationServicesDeleteNode(InputObject.ResourceGroupName ?? null, InputObject.SqlMigrationServiceName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded.cs new file mode 100644 index 000000000000..f064d4e83141 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete the integration runtime node. + /// + /// [OpenAPI] DeleteNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete the integration runtime node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// The name of integration runtime. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of integration runtime.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of integration runtime.", + SerializedName = @"integrationRuntimeName", + PossibleTypes = new [] { typeof(string) })] + public string IntegrationRuntimeName { get => ParametersBody.IntegrationRuntimeName ?? null; set => ParametersBody.IntegrationRuntimeName = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The name of node to delete. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of node to delete.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of node to delete.", + SerializedName = @"nodeName", + PossibleTypes = new [] { typeof(string) })] + public string NodeName { get => ParametersBody.NodeName ?? null; set => ParametersBody.NodeName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DeleteNode(); + + /// Details of node to be deleted. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesDeleteNode' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SqlMigrationServicesDeleteNodeViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlMigrationServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlMigrationServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SqlMigrationServicesDeleteNode(InputObject.ResourceGroupName ?? null, InputObject.SqlMigrationServiceName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public RemoveAzDataMigrationSqlMigrationServiceNode_DeleteViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDeleteNode + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationService_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationService_Delete.cs new file mode 100644 index 000000000000..e6562ea8d050 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationService_Delete.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete Database Migration Service. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationSqlMigrationService_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete Database Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationSqlMigrationService_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SqlMigrationServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataMigrationSqlMigrationService_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.RemoveAzDataMigrationSqlMigrationService_Delete Clone() + { + var clone = new RemoveAzDataMigrationSqlMigrationService_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesDelete(ResourceGroupName, Name, SubscriptionId, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,Name=Name,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationSqlMigrationService_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity.cs new file mode 100644 index 000000000000..f5d4b57ea271 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Delete Database Migration Service. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationSqlMigrationService_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Delete Database Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SqlMigrationServicesDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlMigrationServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlMigrationServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SqlMigrationServicesDelete(InputObject.ResourceGroupName ?? null, InputObject.SqlMigrationServiceName ?? null, InputObject.SubscriptionId ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationSqlMigrationService_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationTask_Delete.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationTask_Delete.cs new file mode 100644 index 000000000000..027a7a6159e1 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationTask_Delete.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationTask_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationTask_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TaskName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksDelete(SubscriptionId, GroupName, ServiceName, ProjectName, Name, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name,DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationTask_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationTask_DeleteViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationTask_DeleteViaIdentity.cs new file mode 100644 index 000000000000..82529302ace3 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/RemoveAzDataMigrationTask_DeleteViaIdentity.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataMigrationTask_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class RemoveAzDataMigrationTask_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _deleteRunningTask; + + /// Delete the resource even if it contains running tasks + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Delete the resource even if it contains running tasks")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delete the resource even if it contains running tasks", + SerializedName = @"deleteRunningTasks", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter DeleteRunningTask { get => this._deleteRunningTask; set => this._deleteRunningTask = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TasksDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TasksDelete(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.TaskName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?), onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataMigrationTask_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeleteRunningTask=this.InvocationInformation.BoundParameters.ContainsKey("DeleteRunningTask") ? DeleteRunningTask : default(global::System.Management.Automation.SwitchParameter?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StartAzDataMigrationService_Start.cs b/swaggerci/datamigration/generated/cmdlets/StartAzDataMigrationService_Start.cs new file mode 100644 index 000000000000..30906f9eb48a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StartAzDataMigrationService_Start.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Start=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzDataMigrationService_Start", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StartAzDataMigrationService_Start : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzDataMigrationService_Start + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StartAzDataMigrationService_Start Clone() + { + var clone = new StartAzDataMigrationService_Start(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.GroupName = this.GroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesStart' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesStart(SubscriptionId, GroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzDataMigrationService_Start() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StartAzDataMigrationService_StartViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/StartAzDataMigrationService_StartViaIdentity.cs new file mode 100644 index 000000000000..b5ebc0acd59f --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StartAzDataMigrationService_StartViaIdentity.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Start=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzDataMigrationService_StartViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StartAzDataMigrationService_StartViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzDataMigrationService_StartViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StartAzDataMigrationService_StartViaIdentity Clone() + { + var clone = new StartAzDataMigrationService_StartViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesStart' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesStartViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesStart(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzDataMigrationService_StartViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel.cs new file mode 100644 index 000000000000..146a6a65b6cc --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop on going migration for the database. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlDb_Cancel", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop on going migration for the database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlDbInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlDbInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlDbInstanceName { get => this._sqlDbInstanceName; set => this._sqlDbInstanceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlDbInstanceName = this.SqlDbInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlDbCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlDbCancel(ResourceGroupName, SqlDbInstanceName, TargetDbName, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlDbInstanceName=SqlDbInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlDb_Cancel() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlDbInstanceName=SqlDbInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded.cs new file mode 100644 index 000000000000..4af818f0937f --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop on going migration for the database. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop on going migration for the database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlDbInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlDbInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlDbInstanceName { get => this._sqlDbInstanceName; set => this._sqlDbInstanceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlDbInstanceName = this.SqlDbInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlDbCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlDbCancel(ResourceGroupName, SqlDbInstanceName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlDbInstanceName=SqlDbInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlDb_CancelExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlDbInstanceName=SqlDbInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity.cs new file mode 100644 index 000000000000..38531fa0f73a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop on going migration for the database. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop on going migration for the database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlDbCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlDbCancelViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlDbInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlDbInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlDbCancel(InputObject.ResourceGroupName ?? null, InputObject.SqlDbInstanceName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded.cs new file mode 100644 index 000000000000..63d465a0747b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop on going migration for the database. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop on going migration for the database.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlDbCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlDbCancelViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlDbInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlDbInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlDbCancel(InputObject.ResourceGroupName ?? null, InputObject.SqlDbInstanceName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlDb_CancelViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel.cs new file mode 100644 index 000000000000..cfecc1687bb3 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL Managed Instance. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlMi_Cancel", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managedInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"managedInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ManagedInstanceName { get => this._managedInstanceName; set => this._managedInstanceName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagedInstanceName = this.ManagedInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlMiCancel(ResourceGroupName, ManagedInstanceName, TargetDbName, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ManagedInstanceName=ManagedInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlMi_Cancel() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ManagedInstanceName=ManagedInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded.cs new file mode 100644 index 000000000000..b453970989a7 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL Managed Instance. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managedInstanceName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"managedInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ManagedInstanceName { get => this._managedInstanceName; set => this._managedInstanceName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagedInstanceName = this.ManagedInstanceName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlMiCancel(ResourceGroupName, ManagedInstanceName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ManagedInstanceName=ManagedInstanceName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlMi_CancelExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ManagedInstanceName=ManagedInstanceName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity.cs new file mode 100644 index 000000000000..8b6e604d6c6e --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL Managed Instance. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlMiCancelViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagedInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagedInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlMiCancel(InputObject.ResourceGroupName ?? null, InputObject.ManagedInstanceName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded.cs new file mode 100644 index 000000000000..4ffe17610aa6 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL Managed Instance. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL Managed Instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlMiCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlMiCancelViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagedInstanceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagedInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlMiCancel(InputObject.ResourceGroupName ?? null, InputObject.ManagedInstanceName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlMi_CancelViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel.cs new file mode 100644 index 000000000000..7469df325f24 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL VM. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlVM_Cancel", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlVirtualMachineName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlVirtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlVirtualMachineName { get => this._sqlVirtualMachineName; set => this._sqlVirtualMachineName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlVirtualMachineName = this.SqlVirtualMachineName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlVMCancel(ResourceGroupName, SqlVirtualMachineName, TargetDbName, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlVirtualMachineName=SqlVirtualMachineName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlVM_Cancel() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlVirtualMachineName=SqlVirtualMachineName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded.cs new file mode 100644 index 000000000000..58ecdc8e753d --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL VM. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _sqlVirtualMachineName; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"sqlVirtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SqlVirtualMachineName { get => this._sqlVirtualMachineName; set => this._sqlVirtualMachineName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _targetDbName; + + /// The name of the target database. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the target database.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the target database.", + SerializedName = @"targetDbName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TargetDbName { get => this._targetDbName; set => this._targetDbName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SqlVirtualMachineName = this.SqlVirtualMachineName; + clone.TargetDbName = this.TargetDbName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DatabaseMigrationsSqlVMCancel(ResourceGroupName, SqlVirtualMachineName, TargetDbName, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SqlVirtualMachineName=SqlVirtualMachineName,TargetDbName=TargetDbName,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlVM_CancelExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SqlVirtualMachineName=SqlVirtualMachineName, TargetDbName=TargetDbName, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity.cs new file mode 100644 index 000000000000..86116e9a25ab --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL VM. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parameter; + + /// Migration Operation Input + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Migration Operation Input", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Migration Operation Input", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlVMCancelViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlVirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlVirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlVMCancel(InputObject.ResourceGroupName ?? null, InputObject.SqlVirtualMachineName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded.cs new file mode 100644 index 000000000000..4a1469019279 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Stop in-progress database migration to SQL VM. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Stop in-progress database migration to SQL VM.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// ID tracking migration operation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID tracking migration operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID tracking migration operation.", + SerializedName = @"migrationOperationId", + PossibleTypes = new [] { typeof(string) })] + public string MigrationOperationId { get => ParametersBody.MigrationOperationId ?? null; set => ParametersBody.MigrationOperationId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.MigrationOperationInput(); + + /// Migration Operation Input + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IMigrationOperationInput ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded Clone() + { + var clone = new StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatabaseMigrationsSqlVMCancel' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatabaseMigrationsSqlVMCancelViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlVirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlVirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TargetDbName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TargetDbName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatabaseMigrationsSqlVMCancel(InputObject.ResourceGroupName ?? null, InputObject.SqlVirtualMachineName ?? null, InputObject.TargetDbName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public StopAzDataMigrationDatabaseMigrationsSqlVM_CancelViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationServiceTask_Cancel.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationServiceTask_Cancel.cs new file mode 100644 index 000000000000..038e4e03af4f --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationServiceTask_Cancel.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + /// cancels a service task if it's currently queued or running. + /// + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationServiceTask_Cancel", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a service task if it's currently queued or running.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationServiceTask_Cancel : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServiceTasksCancel' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServiceTasksCancel(SubscriptionId, GroupName, ServiceName, TaskName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,TaskName=TaskName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationServiceTask_Cancel() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationServiceTask_CancelViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationServiceTask_CancelViaIdentity.cs new file mode 100644 index 000000000000..e61bd257e3f3 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationServiceTask_CancelViaIdentity.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + /// cancels a service task if it's currently queued or running. + /// + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationServiceTask_CancelViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a service task if it's currently queued or running.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationServiceTask_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServiceTasksCancel' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServiceTasksCancelViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServiceTasksCancel(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.TaskName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationServiceTask_CancelViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationService_Stop.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationService_Stop.cs new file mode 100644 index 000000000000..559cbac601ac --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationService_Stop.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Stop=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationService_Stop", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationService_Stop : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzDataMigrationService_Stop + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationService_Stop Clone() + { + var clone = new StopAzDataMigrationService_Stop(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.GroupName = this.GroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesStop' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesStop(SubscriptionId, GroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationService_Stop() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationService_StopViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationService_StopViaIdentity.cs new file mode 100644 index 000000000000..17880a52a1a9 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationService_StopViaIdentity.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Stop=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationService_StopViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationService_StopViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzDataMigrationService_StopViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.StopAzDataMigrationService_StopViaIdentity Clone() + { + var clone = new StopAzDataMigrationService_StopViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesStop' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesStopViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesStop(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationService_StopViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationTask_Cancel.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationTask_Cancel.cs new file mode 100644 index 000000000000..d18a76d482fc --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationTask_Cancel.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationTask_Cancel", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationTask_Cancel : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TaskName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksCancel' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksCancel(SubscriptionId, GroupName, ServiceName, ProjectName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationTask_Cancel() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationTask_CancelViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationTask_CancelViaIdentity.cs new file mode 100644 index 000000000000..a40228852e0f --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/StopAzDataMigrationTask_CancelViaIdentity.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzDataMigrationTask_CancelViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class StopAzDataMigrationTask_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksCancel' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TasksCancelViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TasksCancel(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.TaskName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzDataMigrationTask_CancelViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_Check.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_Check.cs new file mode 100644 index 000000000000..6578a7679b2f --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_Check.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed nested resource name is valid and available. + /// + /// + /// [OpenAPI] CheckChildrenNameAvailability=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceChildNameAvailability_Check", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed nested resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceChildNameAvailability_Check : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parameter; + + /// A resource type and proposed name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A resource type and proposed name", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A resource type and proposed name", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckChildrenNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesCheckChildrenNameAvailability(SubscriptionId, GroupName, ServiceName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceChildNameAvailability_Check() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckExpanded.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckExpanded.cs new file mode 100644 index 000000000000..db5e8dfedb6a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckExpanded.cs @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed nested resource name is valid and available. + /// + /// + /// [OpenAPI] CheckChildrenNameAvailability=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceChildNameAvailability_CheckExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed nested resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceChildNameAvailability_CheckExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The proposed resource name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The proposed resource name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The proposed resource name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => ParametersBody.Name ?? null; set => ParametersBody.Name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityRequest(); + + /// A resource type and proposed name + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// The resource type chain (e.g. virtualMachines/extensions) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type chain (e.g. virtualMachines/extensions)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type chain (e.g. virtualMachines/extensions)", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => ParametersBody.Type ?? null; set => ParametersBody.Type = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckChildrenNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesCheckChildrenNameAvailability(SubscriptionId, GroupName, ServiceName, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceChildNameAvailability_CheckExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentity.cs new file mode 100644 index 000000000000..bddebcec69a9 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentity.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed nested resource name is valid and available. + /// + /// + /// [OpenAPI] CheckChildrenNameAvailability=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceChildNameAvailability_CheckViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed nested resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parameter; + + /// A resource type and proposed name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A resource type and proposed name", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A resource type and proposed name", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckChildrenNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesCheckChildrenNameAvailabilityViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesCheckChildrenNameAvailability(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentity() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded.cs new file mode 100644 index 000000000000..2b073a0daf0b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed nested resource name is valid and available. + /// + /// + /// [OpenAPI] CheckChildrenNameAvailability=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed nested resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The proposed resource name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The proposed resource name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The proposed resource name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => ParametersBody.Name ?? null; set => ParametersBody.Name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityRequest(); + + /// A resource type and proposed name + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The resource type chain (e.g. virtualMachines/extensions) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type chain (e.g. virtualMachines/extensions)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type chain (e.g. virtualMachines/extensions)", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => ParametersBody.Type ?? null; set => ParametersBody.Type = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckChildrenNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesCheckChildrenNameAvailabilityViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesCheckChildrenNameAvailability(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceChildNameAvailability_CheckViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_Check.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_Check.cs new file mode 100644 index 000000000000..ddd9c095b8e3 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_Check.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed top-level resource name is valid and available. + /// + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceNameAvailability_Check", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed top-level resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceNameAvailability_Check : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// The Azure region of the operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Azure region of the operation")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Azure region of the operation", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parameter; + + /// A resource type and proposed name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A resource type and proposed name", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A resource type and proposed name", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesCheckNameAvailability(SubscriptionId, Location, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceNameAvailability_Check() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckExpanded.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckExpanded.cs new file mode 100644 index 000000000000..a527da6ed389 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckExpanded.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed top-level resource name is valid and available. + /// + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceNameAvailability_CheckExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed top-level resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceNameAvailability_CheckExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// The Azure region of the operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Azure region of the operation")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Azure region of the operation", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The proposed resource name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The proposed resource name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The proposed resource name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => ParametersBody.Name ?? null; set => ParametersBody.Name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityRequest(); + + /// A resource type and proposed name + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// The resource type chain (e.g. virtualMachines/extensions) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type chain (e.g. virtualMachines/extensions)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type chain (e.g. virtualMachines/extensions)", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => ParametersBody.Type ?? null; set => ParametersBody.Type = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesCheckNameAvailability(SubscriptionId, Location, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceNameAvailability_CheckExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckViaIdentity.cs new file mode 100644 index 000000000000..69d533bf3db7 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckViaIdentity.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed top-level resource name is valid and available. + /// + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceNameAvailability_CheckViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed top-level resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceNameAvailability_CheckViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parameter; + + /// A resource type and proposed name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A resource type and proposed name", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A resource type and proposed name", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesCheckNameAvailabilityViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Location) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Location"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesCheckNameAvailability(InputObject.SubscriptionId ?? null, InputObject.Location ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceNameAvailability_CheckViaIdentity() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded.cs new file mode 100644 index 000000000000..78a9cbe030f2 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded.cs @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// This method checks whether a proposed top-level resource name is valid and available. + /// + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method checks whether a proposed top-level resource name is valid and available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The proposed resource name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The proposed resource name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The proposed resource name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => ParametersBody.Name ?? null; set => ParametersBody.Name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.NameAvailabilityRequest(); + + /// A resource type and proposed name + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityRequest ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The resource type chain (e.g. virtualMachines/extensions) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type chain (e.g. virtualMachines/extensions)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type chain (e.g. virtualMachines/extensions)", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => ParametersBody.Type ?? null; set => ParametersBody.Type = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesCheckNameAvailabilityViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Location) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Location"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesCheckNameAvailability(InputObject.SubscriptionId ?? null, InputObject.Location ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public TestAzDataMigrationServiceNameAvailability_CheckViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.INameAvailabilityResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceStatus_Check.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceStatus_Check.cs new file mode 100644 index 000000000000..4a85e8f3d8a4 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceStatus_Check.cs @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CheckStatus=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceStatus_Check", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceStatus_Check : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckStatus' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesCheckStatus(SubscriptionId, GroupName, ServiceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceStatus_Check() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceStatus_CheckViaIdentity.cs b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceStatus_CheckViaIdentity.cs new file mode 100644 index 000000000000..bd086ce1d42a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/TestAzDataMigrationServiceStatus_CheckViaIdentity.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CheckStatus=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataMigrationServiceStatus_CheckViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class TestAzDataMigrationServiceStatus_CheckViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCheckStatus' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesCheckStatusViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesCheckStatus(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataMigrationServiceStatus_CheckViaIdentity() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationServiceStatusResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationFile_UpdateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationFile_UpdateExpanded.cs new file mode 100644 index 000000000000..944eb04f18ac --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationFile_UpdateExpanded.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// This method updates an existing file. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationFile_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method updates an existing file.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationFile_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.", + SerializedName = @"extension", + PossibleTypes = new [] { typeof(string) })] + public string Extension { get => ParametersBody.Extension ?? null; set => ParametersBody.Extension = value; } + + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Relative path of this file resource. This property can be set when creating or updating the file resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative path of this file resource. This property can be set when creating or updating the file resource.", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + public string FilePath { get => ParametersBody.FilePath ?? null; set => ParametersBody.FilePath = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// File content type. This property can be modified to reflect the file content type. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "File content type. This property can be modified to reflect the file content type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File content type. This property can be modified to reflect the file content type.", + SerializedName = @"mediaType", + PossibleTypes = new [] { typeof(string) })] + public string MediaType { get => ParametersBody.MediaType ?? null; set => ParametersBody.MediaType = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the File + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the File")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the File", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile(); + + /// A file resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FilesUpdate(SubscriptionId, GroupName, ServiceName, ProjectName, Name, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationFile_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationFile_UpdateViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationFile_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..550230518da6 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationFile_UpdateViaIdentityExpanded.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// This method updates an existing file. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationFile_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"This method updates an existing file.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationFile_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// + /// Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.", + SerializedName = @"extension", + PossibleTypes = new [] { typeof(string) })] + public string Extension { get => ParametersBody.Extension ?? null; set => ParametersBody.Extension = value; } + + /// + /// Relative path of this file resource. This property can be set when creating or updating the file resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Relative path of this file resource. This property can be set when creating or updating the file resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative path of this file resource. This property can be set when creating or updating the file resource.", + SerializedName = @"filePath", + PossibleTypes = new [] { typeof(string) })] + public string FilePath { get => ParametersBody.FilePath ?? null; set => ParametersBody.FilePath = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// File content type. This property can be modified to reflect the file content type. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "File content type. This property can be modified to reflect the file content type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File content type. This property can be modified to reflect the file content type.", + SerializedName = @"mediaType", + PossibleTypes = new [] { typeof(string) })] + public string MediaType { get => ParametersBody.MediaType ?? null; set => ParametersBody.MediaType = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectFile(); + + /// A file resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FilesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FilesUpdateViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FilesUpdate(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.FileName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationFile_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectFile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationProject_UpdateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationProject_UpdateExpanded.cs new file mode 100644 index 000000000000..5210278b5992 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationProject_UpdateExpanded.cs @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing + /// project. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationProject_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationProject_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Key used to authenticate to the Azure Active Directory Application + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key used to authenticate to the Azure Active Directory Application")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoAppKey { get => ParametersBody.AzureAuthenticationInfoAppKey ?? null; set => ParametersBody.AzureAuthenticationInfoAppKey = value; } + + /// Application ID of the Azure Active Directory Application + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Application ID of the Azure Active Directory Application")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoApplicationId { get => ParametersBody.AzureAuthenticationInfoApplicationId ?? null; set => ParametersBody.AzureAuthenticationInfoApplicationId = value; } + + /// Ignore checking azure permissions on the AAD app + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ignore checking azure permissions on the AAD app")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AzureAuthenticationInfoIgnoreAzurePermission { get => ParametersBody.AzureAuthenticationInfoIgnoreAzurePermission ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.AzureAuthenticationInfoIgnoreAzurePermission = value; } + + /// Tenant id of the customer + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tenant id of the customer")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoTenantId { get => ParametersBody.AzureAuthenticationInfoTenantId ?? null; set => ParametersBody.AzureAuthenticationInfoTenantId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// List of DatabaseInfo + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of DatabaseInfo")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of DatabaseInfo", + SerializedName = @"databasesInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get => ParametersBody.DatabasesInfo ?? null /* arrayOf */; set => ParametersBody.DatabasesInfo = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location ?? null; set => ParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ProjectName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project(); + + /// A project resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Password credential. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoPassword { get => ParametersBody.SourceConnectionInfoPassword ?? null; set => ParametersBody.SourceConnectionInfoPassword = value; } + + /// Type of connection info + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of connection info")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoType { get => ParametersBody.SourceConnectionInfoType ?? null; set => ParametersBody.SourceConnectionInfoType = value; } + + /// User name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoUserName { get => ParametersBody.SourceConnectionInfoUserName ?? null; set => ParametersBody.SourceConnectionInfoUserName = value; } + + /// Source platform for the project + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source platform for the project")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source platform for the project", + SerializedName = @"sourcePlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform SourcePlatform { get => ParametersBody.SourcePlatform ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform)""); set => ParametersBody.SourcePlatform = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// Password credential. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoPassword { get => ParametersBody.TargetConnectionInfoPassword ?? null; set => ParametersBody.TargetConnectionInfoPassword = value; } + + /// Type of connection info + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of connection info")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoType { get => ParametersBody.TargetConnectionInfoType ?? null; set => ParametersBody.TargetConnectionInfoType = value; } + + /// User name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoUserName { get => ParametersBody.TargetConnectionInfoUserName ?? null; set => ParametersBody.TargetConnectionInfoUserName = value; } + + /// Target platform for the project + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Target platform for the project")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target platform for the project", + SerializedName = @"targetPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform TargetPlatform { get => ParametersBody.TargetPlatform ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform)""); set => ParametersBody.TargetPlatform = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ProjectsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ProjectsUpdate(SubscriptionId, GroupName, ServiceName, Name, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationProject_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationProject_UpdateViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationProject_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..30d7fca1e204 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationProject_UpdateViaIdentityExpanded.cs @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing + /// project. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationProject_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationProject_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Key used to authenticate to the Azure Active Directory Application + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key used to authenticate to the Azure Active Directory Application")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key used to authenticate to the Azure Active Directory Application", + SerializedName = @"appKey", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoAppKey { get => ParametersBody.AzureAuthenticationInfoAppKey ?? null; set => ParametersBody.AzureAuthenticationInfoAppKey = value; } + + /// Application ID of the Azure Active Directory Application + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Application ID of the Azure Active Directory Application")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application ID of the Azure Active Directory Application", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoApplicationId { get => ParametersBody.AzureAuthenticationInfoApplicationId ?? null; set => ParametersBody.AzureAuthenticationInfoApplicationId = value; } + + /// Ignore checking azure permissions on the AAD app + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ignore checking azure permissions on the AAD app")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore checking azure permissions on the AAD app", + SerializedName = @"ignoreAzurePermissions", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AzureAuthenticationInfoIgnoreAzurePermission { get => ParametersBody.AzureAuthenticationInfoIgnoreAzurePermission ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.AzureAuthenticationInfoIgnoreAzurePermission = value; } + + /// Tenant id of the customer + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tenant id of the customer")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant id of the customer", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string AzureAuthenticationInfoTenantId { get => ParametersBody.AzureAuthenticationInfoTenantId ?? null; set => ParametersBody.AzureAuthenticationInfoTenantId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// List of DatabaseInfo + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of DatabaseInfo")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of DatabaseInfo", + SerializedName = @"databasesInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDatabaseInfo[] DatabasesInfo { get => ParametersBody.DatabasesInfo ?? null /* arrayOf */; set => ParametersBody.DatabasesInfo = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location ?? null; set => ParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.Project(); + + /// A project resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Password credential. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoPassword { get => ParametersBody.SourceConnectionInfoPassword ?? null; set => ParametersBody.SourceConnectionInfoPassword = value; } + + /// Type of connection info + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of connection info")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoType { get => ParametersBody.SourceConnectionInfoType ?? null; set => ParametersBody.SourceConnectionInfoType = value; } + + /// User name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string SourceConnectionInfoUserName { get => ParametersBody.SourceConnectionInfoUserName ?? null; set => ParametersBody.SourceConnectionInfoUserName = value; } + + /// Source platform for the project + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source platform for the project")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source platform for the project", + SerializedName = @"sourcePlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform SourcePlatform { get => ParametersBody.SourcePlatform ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectSourcePlatform)""); set => ParametersBody.SourcePlatform = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// Password credential. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Password credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password credential.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoPassword { get => ParametersBody.TargetConnectionInfoPassword ?? null; set => ParametersBody.TargetConnectionInfoPassword = value; } + + /// Type of connection info + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of connection info")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of connection info", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoType { get => ParametersBody.TargetConnectionInfoType ?? null; set => ParametersBody.TargetConnectionInfoType = value; } + + /// User name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User name", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string TargetConnectionInfoUserName { get => ParametersBody.TargetConnectionInfoUserName ?? null; set => ParametersBody.TargetConnectionInfoUserName = value; } + + /// Target platform for the project + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Target platform for the project")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target platform for the project", + SerializedName = @"targetPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform TargetPlatform { get => ParametersBody.TargetPlatform ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.ProjectTargetPlatform)""); set => ParametersBody.TargetPlatform = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ProjectsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ProjectsUpdateViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ProjectsUpdate(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationProject_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProject + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationServiceTask_UpdateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationServiceTask_UpdateExpanded.cs new file mode 100644 index 000000000000..a28d69553857 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationServiceTask_UpdateExpanded.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method + /// updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to + /// do so. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationServiceTask_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationServiceTask_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Key value pairs of client data to attach meta data information to task + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key value pairs of client data to attach meta data information to task")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ParametersBody.ClientData ?? null /* object */; set => ParametersBody.ClientData = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask(); + + /// A task resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _taskName; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string TaskName { get => this._taskName; set => this._taskName = value; } + + /// Task type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Task type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ParametersBody.TaskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType)""); set => ParametersBody.TaskType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServiceTasksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServiceTasksUpdate(SubscriptionId, GroupName, ServiceName, TaskName, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,TaskName=TaskName,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationServiceTask_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, TaskName=TaskName, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationServiceTask_UpdateViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationServiceTask_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..d1e4052bf751 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationServiceTask_UpdateViaIdentityExpanded.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method + /// updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to + /// do so. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationServiceTask_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there is little reason to do so.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationServiceTask_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Key value pairs of client data to attach meta data information to task + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key value pairs of client data to attach meta data information to task")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ParametersBody.ClientData ?? null /* object */; set => ParametersBody.ClientData = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask(); + + /// A task resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Task type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Task type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ParametersBody.TaskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType)""); set => ParametersBody.TaskType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServiceTasksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServiceTasksUpdateViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServiceTasksUpdate(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.TaskName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationServiceTask_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationService_UpdateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationService_UpdateExpanded.cs new file mode 100644 index 000000000000..a0db36f465c9 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationService_UpdateExpanded.cs @@ -0,0 +1,648 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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\"). + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationService_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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\"").")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationService_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The time delay before the service is auto-stopped when idle. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time delay before the service is auto-stopped when idle.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time delay before the service is auto-stopped when idle.", + SerializedName = @"autoStopDelay", + PossibleTypes = new [] { typeof(string) })] + public string AutoStopDelay { get => ParametersBody.AutoStopDelay ?? null; set => ParametersBody.AutoStopDelay = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether service resources should be deleted when stopped. (Turned on by default)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether service resources should be deleted when stopped. (Turned on by default)", + SerializedName = @"deleteResourcesOnStop", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DeleteResourcesOnStop { get => ParametersBody.DeleteResourcesOnStop ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.DeleteResourcesOnStop = value; } + + /// HTTP strong entity tag value. Ignored if submitted + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. Ignored if submitted")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. Ignored if submitted", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The resource kind. Only 'vm' (the default) is supported. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource kind. Only 'vm' (the default) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource kind. Only 'vm' (the default) is supported.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + public string Kind { get => ParametersBody.Kind ?? null; set => ParametersBody.Kind = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location ?? null; set => ParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService(); + + /// A Database Migration Service resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The public key of the service, used to encrypt secrets sent to the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The public key of the service, used to encrypt secrets sent to the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The public key of the service, used to encrypt secrets sent to the service", + SerializedName = @"publicKey", + PossibleTypes = new [] { typeof(string) })] + public string PublicKey { get => ParametersBody.PublicKey ?? null; set => ParametersBody.PublicKey = value; } + + /// The capacity of the SKU, if it supports scaling + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The capacity of the SKU, if it supports scaling")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity of the SKU, if it supports scaling", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + public int SkuCapacity { get => ParametersBody.SkuCapacity ?? default(int); set => ParametersBody.SkuCapacity = value; } + + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + public string SkuFamily { get => ParametersBody.SkuFamily ?? null; set => ParametersBody.SkuFamily = value; } + + /// The unique name of the SKU, such as 'P3' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique name of the SKU, such as 'P3'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique name of the SKU, such as 'P3'", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string SkuName { get => ParametersBody.SkuName ?? null; set => ParametersBody.SkuName = value; } + + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + public string SkuSize { get => ParametersBody.SkuSize ?? null; set => ParametersBody.SkuSize = value; } + + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + public string SkuTier { get => ParametersBody.SkuTier ?? null; set => ParametersBody.SkuTier = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Microsoft.Network/networkInterfaces resource which the service have")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/networkInterfaces resource which the service have", + SerializedName = @"virtualNicId", + PossibleTypes = new [] { typeof(string) })] + public string VirtualNicId { get => ParametersBody.VirtualNicId ?? null; set => ParametersBody.VirtualNicId = value; } + + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined", + SerializedName = @"virtualSubnetId", + PossibleTypes = new [] { typeof(string) })] + public string VirtualSubnetId { get => ParametersBody.VirtualSubnetId ?? null; set => ParametersBody.VirtualSubnetId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataMigrationService_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.UpdateAzDataMigrationService_UpdateExpanded Clone() + { + var clone = new UpdateAzDataMigrationService_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.GroupName = this.GroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesUpdate(SubscriptionId, GroupName, Name, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationService_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationService_UpdateViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationService_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..ecd35addba0c --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationService_UpdateViaIdentityExpanded.cs @@ -0,0 +1,626 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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\"). + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationService_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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\"").")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationService_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The time delay before the service is auto-stopped when idle. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time delay before the service is auto-stopped when idle.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time delay before the service is auto-stopped when idle.", + SerializedName = @"autoStopDelay", + PossibleTypes = new [] { typeof(string) })] + public string AutoStopDelay { get => ParametersBody.AutoStopDelay ?? null; set => ParametersBody.AutoStopDelay = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Whether service resources should be deleted when stopped. (Turned on by default) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether service resources should be deleted when stopped. (Turned on by default)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether service resources should be deleted when stopped. (Turned on by default)", + SerializedName = @"deleteResourcesOnStop", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DeleteResourcesOnStop { get => ParametersBody.DeleteResourcesOnStop ?? default(global::System.Management.Automation.SwitchParameter); set => ParametersBody.DeleteResourcesOnStop = value; } + + /// HTTP strong entity tag value. Ignored if submitted + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. Ignored if submitted")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. Ignored if submitted", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The resource kind. Only 'vm' (the default) is supported. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource kind. Only 'vm' (the default) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource kind. Only 'vm' (the default) is supported.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + public string Kind { get => ParametersBody.Kind ?? null; set => ParametersBody.Kind = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location ?? null; set => ParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.DataMigrationService(); + + /// A Database Migration Service resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The public key of the service, used to encrypt secrets sent to the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The public key of the service, used to encrypt secrets sent to the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The public key of the service, used to encrypt secrets sent to the service", + SerializedName = @"publicKey", + PossibleTypes = new [] { typeof(string) })] + public string PublicKey { get => ParametersBody.PublicKey ?? null; set => ParametersBody.PublicKey = value; } + + /// The capacity of the SKU, if it supports scaling + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The capacity of the SKU, if it supports scaling")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity of the SKU, if it supports scaling", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + public int SkuCapacity { get => ParametersBody.SkuCapacity ?? default(int); set => ParametersBody.SkuCapacity = value; } + + /// + /// The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual + /// machines + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + public string SkuFamily { get => ParametersBody.SkuFamily ?? null; set => ParametersBody.SkuFamily = value; } + + /// The unique name of the SKU, such as 'P3' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique name of the SKU, such as 'P3'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique name of the SKU, such as 'P3'", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string SkuName { get => ParametersBody.SkuName ?? null; set => ParametersBody.SkuName = value; } + + /// + /// The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes + /// within a family, e.g. 'A1' for virtual machines + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + public string SkuSize { get => ParametersBody.SkuSize ?? null; set => ParametersBody.SkuSize = value; } + + /// The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + public string SkuTier { get => ParametersBody.SkuTier ?? null; set => ParametersBody.SkuTier = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ITrackedResourceTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// + /// The ID of the Microsoft.Network/networkInterfaces resource which the service have + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Microsoft.Network/networkInterfaces resource which the service have")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/networkInterfaces resource which the service have", + SerializedName = @"virtualNicId", + PossibleTypes = new [] { typeof(string) })] + public string VirtualNicId { get => ParametersBody.VirtualNicId ?? null; set => ParametersBody.VirtualNicId = value; } + + /// + /// The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined", + SerializedName = @"virtualSubnetId", + PossibleTypes = new [] { typeof(string) })] + public string VirtualSubnetId { get => ParametersBody.VirtualSubnetId ?? null; set => ParametersBody.VirtualSubnetId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataMigrationService_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.UpdateAzDataMigrationService_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzDataMigrationService_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ServicesUpdateViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ServicesUpdate(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationService_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IDataMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationSqlMigrationService_UpdateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationSqlMigrationService_UpdateExpanded.cs new file mode 100644 index 000000000000..788ca2af410a --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationSqlMigrationService_UpdateExpanded.cs @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Update Database Migration Service. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationSqlMigrationService_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Update Database Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationSqlMigrationService_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the SQL Migration Service. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the SQL Migration Service.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the SQL Migration Service.", + SerializedName = @"sqlMigrationServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SqlMigrationServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdate(); + + /// An update to a SQL Migration Service. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or + /// the portal. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataMigrationSqlMigrationService_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.UpdateAzDataMigrationSqlMigrationService_UpdateExpanded Clone() + { + var clone = new UpdateAzDataMigrationSqlMigrationService_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SqlMigrationServicesUpdate(ResourceGroupName, Name, SubscriptionId, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,Name=Name,SubscriptionId=SubscriptionId,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationSqlMigrationService_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..076e87703fc4 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// Update Database Migration Service. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"Update Database Migration Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.SqlMigrationServiceUpdate(); + + /// An update to a SQL Migration Service. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdate ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationServiceUpdateTags Tag { get => ParametersBody.Tag ?? null /* object */; set => ParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets.UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ParametersBody = this.ParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SqlMigrationServicesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SqlMigrationServicesUpdateViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SqlMigrationServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SqlMigrationServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SqlMigrationServicesUpdate(InputObject.ResourceGroupName ?? null, InputObject.SqlMigrationServiceName ?? null, InputObject.SubscriptionId ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzDataMigrationSqlMigrationService_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ISqlMigrationService + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationTask_UpdateExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationTask_UpdateExpanded.cs new file mode 100644 index 000000000000..573437d50b8b --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationTask_UpdateExpanded.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationTask_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationTask_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Key value pairs of client data to attach meta data information to task + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key value pairs of client data to attach meta data information to task")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ParametersBody.ClientData ?? null /* object */; set => ParametersBody.ClientData = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// Backing field for property. + private string _groupName; + + /// Name of the resource group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource group")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource group", + SerializedName = @"groupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string GroupName { get => this._groupName; set => this._groupName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the Task + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Task")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Task", + SerializedName = @"taskName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TaskName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask(); + + /// A task resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _projectName; + + /// Name of the project + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the project")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the project", + SerializedName = @"projectName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ProjectName { get => this._projectName; set => this._projectName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _serviceName; + + /// Name of the service + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the service")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the service", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID that identifies an Azure subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription ID that identifies an Azure subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription ID that identifies an Azure subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Task type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Task type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ParametersBody.TaskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType)""); set => ParametersBody.TaskType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TasksUpdate(SubscriptionId, GroupName, ServiceName, ProjectName, Name, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,GroupName=GroupName,ServiceName=ServiceName,ProjectName=ProjectName,Name=Name,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationTask_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, GroupName=GroupName, ServiceName=ServiceName, ProjectName=ProjectName, Name=Name, body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationTask_UpdateViaIdentityExpanded.cs b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationTask_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..c2ab92600503 --- /dev/null +++ b/swaggerci/datamigration/generated/cmdlets/UpdateAzDataMigrationTask_UpdateViaIdentityExpanded.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataMigrationTask_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Generated] + public partial class UpdateAzDataMigrationTask_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.DataMigrationManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.ClientAPI; + + /// Key value pairs of client data to attach meta data information to task + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Key value pairs of client data to attach meta data information to task")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key value pairs of client data to attach meta data information to task", + SerializedName = @"clientData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTaskPropertiesClientData ClientData { get => ParametersBody.ClientData ?? null /* object */; set => ParametersBody.ClientData = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// HTTP strong entity tag value. This is ignored if submitted. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "HTTP strong entity tag value. This is ignored if submitted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP strong entity tag value. This is ignored if submitted.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => ParametersBody.Etag ?? null; set => ParametersBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.IDataMigrationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.ProjectTask(); + + /// A task resource + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Task type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Task type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataMigration.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Task type.", + SerializedName = @"taskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType TaskType { get => ParametersBody.TaskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support.TaskType)""); set => ParametersBody.TaskType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TasksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TasksUpdateViaIdentity(InputObject.Id, ParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProjectName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProjectName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TaskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TaskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TasksUpdate(InputObject.SubscriptionId ?? null, InputObject.GroupName ?? null, InputObject.ServiceName ?? null, InputObject.ProjectName ?? null, InputObject.TaskName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataMigrationTask_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IProjectTask + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml new file mode 100644 index 000000000000..ae0c12dd4efa --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml @@ -0,0 +1,496 @@ + + + + + AzureErrorRecords + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + AzureErrorRecords + + + $_.InvocationInfo.HistoryId + + + + + + + + ErrorCategory + + + ErrorDetail + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.BoundParameters + + + + $_.InvocationInfo.UnboundParameters + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord] + + + + + RequestId + + + Message + + + ServerMessage + + + ServerResponse + + + RequestMessage + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + StackTrace + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord] + + + + + Message + + + StackTrace + + + + $_.Exception.GetType() + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.HistoryId + + + + + + + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Description + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + Token + + + ExpiresOn + + + Type + + + TenantId + + + UserId + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + + + + Left + + + + Left + + + + Left + + + + + + + + Left + locationPlacementId + + + Left + QuotaId + + + Left + SpendingLimit + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + Id + + + Type + + + Tenants + + + Credential + + + TenantMap + + + CertificateThumbprint + + + + $_.ExtendedProperties.GetEnumerator() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..a81dae94b4db --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml @@ -0,0 +1,468 @@ + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + ResourceManagerUrl + + + Left + ActiveDirectoryAuthority + + + Left + Type + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Id + + + Left + TenantId + + + Left + State + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + $_.Context.Account.ToString() + + + Left + $_.Context.Subscription.Name + + + Left + $_.Context.Tenant.ToString() + + + Left + $_.Context.Environment.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + 40 + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Account + + + Left + $_.Subscription.Name + + + Left + Environment + + + Left + $_.Tenant.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Id + + + Left + $_.Name + + + Left + $_.TenantCategory + + + Left + $_.Domains + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml new file mode 100644 index 000000000000..e3b670a7daff --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml @@ -0,0 +1,303 @@ + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.AuthenticationStoreTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.ProtectedFileTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + Microsoft.Azure.Commands.Profile.Models.AzureContextConverter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec new file mode 100644 index 000000000000..f664d888f3b8 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec @@ -0,0 +1,20 @@ + + + + Az.Accounts + 2.7.5 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + * Added 'SshCredentialFactory' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + + \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 new file mode 100644 index 000000000000..5597a247fce7 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 @@ -0,0 +1,387 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 3/31/2022 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.7.5' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = '17a2feff-488b-47f9-8729-e2cec094624c' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll', + 'Microsoft.Azure.PowerShell.Authentication.dll', + 'Microsoft.Azure.PowerShell.Authenticators.dll', + 'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Clients.Authorization.dll', + 'Microsoft.Azure.PowerShell.Clients.Compute.dll', + 'Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll', + 'Microsoft.Azure.PowerShell.Clients.Monitor.dll', + 'Microsoft.Azure.PowerShell.Clients.Network.dll', + 'Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll', + 'Microsoft.Azure.PowerShell.Clients.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Common.dll', + 'Microsoft.Azure.PowerShell.Storage.dll', + 'Microsoft.Azure.PowerShell.Clients.Storage.Management.dll', + 'Microsoft.Azure.PowerShell.Clients.KeyVault.dll', + 'Microsoft.Azure.PowerShell.Clients.Websites.dll', + 'Hyak.Common.dll', 'Microsoft.ApplicationInsights.dll', + 'Microsoft.Azure.Common.dll', 'Microsoft.Rest.ClientRuntime.dll', + 'Microsoft.Rest.ClientRuntime.Azure.dll', + 'Microsoft.WindowsAzure.Storage.dll', + 'Microsoft.WindowsAzure.Storage.DataMovement.dll', + 'Microsoft.Azure.PowerShell.Clients.Aks.dll', + 'Microsoft.Azure.PowerShell.Strategies.dll', + 'Microsoft.Azure.PowerShell.Common.Share.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'Accounts.format.ps1xml', 'Accounts.generated.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Disable-AzDataCollection', 'Disable-AzContextAutosave', + 'Enable-AzDataCollection', 'Enable-AzContextAutosave', + 'Remove-AzEnvironment', 'Get-AzEnvironment', 'Set-AzEnvironment', + 'Add-AzEnvironment', 'Get-AzSubscription', 'Connect-AzAccount', + 'Get-AzContext', 'Set-AzContext', 'Import-AzContext', 'Save-AzContext', + 'Get-AzTenant', 'Send-Feedback', 'Resolve-AzError', 'Select-AzContext', + 'Rename-AzContext', 'Remove-AzContext', 'Clear-AzContext', + 'Disconnect-AzAccount', 'Get-AzContextAutosaveSetting', + 'Set-AzDefault', 'Get-AzDefault', 'Clear-AzDefault', + 'Register-AzModule', 'Enable-AzureRmAlias', 'Disable-AzureRmAlias', + 'Uninstall-AzureRm', 'Invoke-AzRestMethod', 'Get-AzAccessToken', + 'Open-AzSurveyLink' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Add-AzAccount', 'Login-AzAccount', 'Remove-AzAccount', + 'Logout-AzAccount', 'Select-AzSubscription', 'Resolve-Error', + 'Save-AzProfile', 'Get-AzDomain', 'Invoke-AzRest' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','Accounts','Authentication','Environment','Subscription' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '* Added ''SshCredentialFactory'' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + + +# SIG # Begin signature block +# MIInoQYJKoZIhvcNAQcCoIInkjCCJ44CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBfih7Yjug0H4t7 +# yWl+P37e8ytBZAxLWrUP62/jyADYPKCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZdjCCGXICAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgXA6GKgxI +# VhLOuEe05JK0ofRRaS3Iixk8S4yAEDyheGcwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCk7+MONSYp7vxlpfSvtfVGPGdZ5LuxWlb4eimh/TgO +# qAAMDghpYUB8mFe46dAf/OoVHrcxhCfAof+aWlMkEqZTwIZ6p0XsXZ72jDLDFLgf +# WJNQ605jndPQx7/b3tDvqqI1sCHz4CvYnqiQn4/JpHjiE4321HRDFjhWv1lhTpMx +# Xaifyrvwc1OwLcSqMrEPSShevbYOH54J0MG+qI+t+AQ9D/WQdL/5HBJZ8PDZ2n9b +# I4FxGwm0aeTSnAiV602r8db+jebwv/5ypKfkok4IzN9qdQY1y3jXdP9MfEK2nCod +# Mbuby8eakQsarqZJovnvBOsZANYE8UafuSbYMQtJaEtnoYIXADCCFvwGCisGAQQB +# gjcDAwExghbsMIIW6AYJKoZIhvcNAQcCoIIW2TCCFtUCAQMxDzANBglghkgBZQME +# AgEFADCCAVEGCyqGSIb3DQEJEAEEoIIBQASCATwwggE4AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIPieBDiQ8jeOJOjc2VK1Wl36ph7izu7GPD9rSN/j +# BxeOAgZiFm2JbrQYEzIwMjIwMzMxMTAyMDU2LjYzNlowBIACAfSggdCkgc0wgcox +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1p +# Y3Jvc29mdCBBbWVyaWNhIE9wZXJhdGlvbnMxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOjEyQkMtRTNBRS03NEVCMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNloIIRVzCCBwwwggT0oAMCAQICEzMAAAGhAYVVmblUXYoAAQAAAaEw +# DQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcN +# MjExMjAyMTkwNTI0WhcNMjMwMjI4MTkwNTI0WjCByjELMAkGA1UEBhMCVVMxEzAR +# BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p +# Y3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2Eg +# T3BlcmF0aW9uczEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046MTJCQy1FM0FFLTc0 +# RUIxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0G +# CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDayTxe5WukkrYxxVuHLYW9BEWCD9kk +# jnnHsOKwGddIPbZlLY+l5ovLDNf+BEMQKAZQI3DX91l1yCDuP9X7tOPC48ZRGXA/ +# bf9ql0FK5438gIl7cV528XeEOFwc/A+UbIUfW296Omg8Z62xaQv3jrG4U/priArF +# /er1UA1HNuIGUyqjlygiSPwK2NnFApi1JD+Uef5c47kh7pW1Kj7RnchpFeY9MekP +# QRia7cEaUYU4sqCiJVdDJpefLvPT9EdthlQx75ldx+AwZf2a9T7uQRSBh8tpxPdI +# DDkKiWMwjKTrAY09A3I/jidqPuc8PvX+sqxqyZEN2h4GA0Edjmk64nkIukAK18K5 +# nALDLO9SMTxpAwQIHRDtZeTClvAPCEoy1vtPD7f+eqHqStuu+XCkfRjXEpX9+h9f +# rsB0/BgD5CBf3ELLAa8TefMfHZWEJRTPNrbXMKizSrUSkVv/3HP/ZsJpwaz5My2R +# byc3Ah9bT76eBJkyfT5FN9v/KQ0HnxhRMs6HHhTmNx+LztYci+vHf0D3QH1eCjZW +# ZRjp1mOyxpPU2mDMG6gelvJse1JzRADo7YIok/J3Ccbm8MbBbm85iogFltFHecHF +# EFwrsDGBFnNYHMhcbarQNA+gY2e2l9fAkX3MjI7Uklkoz74/P6KIqe5jcd9FPCbb +# SbYH9OLsteeYOQIDAQABo4IBNjCCATIwHQYDVR0OBBYEFBa/IDLbY475VQyKiZSw +# 47l0/cypMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRY +# MFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01p +# Y3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEF +# BQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9w +# a2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAo +# MSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwgwDQYJKoZI +# hvcNAQELBQADggIBACDDIxElfXlG5YKcKrLPSS+f3JWZprwKEiASvivaHTBRlXtA +# s+TkadcsEei+9w5vmF5tCUzTH4c0nCI7bZxnsL+S6XsiOs3Z1V4WX+IwoXUJ4zLv +# s0+mT4vjGDtYfKQ/bsmJKar2c99m/fHv1Wm2CTcyaePvi86Jh3UyLjdRILWbtzs4 +# oImFMwwKbzHdPopxrBhgi+C1YZshosWLlgzyuxjUl+qNg1m52MJmf11loI7D9HJo +# aQzd+rf928Y8rvULmg2h/G50o+D0UJ1Fa/cJJaHfB3sfKw9X6GrtXYGjmM3+g+Ah +# aVsfupKXNtOFu5tnLKvAH5OIjEDYV1YKmlXuBuhbYassygPFMmNgG2Ank3drEcDc +# ZhCXXqpRszNo1F6Gu5JCpQZXbOJM9Ue5PlJKtmImAYIGsw+pnHy/r5ggSYOp4g5Z +# 1oU9GhVCM3V0T9adee6OUXBk1rE4dZc/UsPlj0qoiljL+lN1A5gkmmz7k5tIObVG +# B7dJdz8J0FwXRE5qYu1AdvauVbZwGQkL1x8aK/svjEQW0NUyJ29znDHiXl5vLoRT +# jjFpshUBi2+IY+mNqbLmj24j5eT+bjDlE3HmNtLPpLcMDYqZ1H+6U6YmaiNmac2j +# RXDAaeEE/uoDMt2dArfJP7M+MDv3zzNNTINeuNEtDVgm9zwfgIUCXnDZuVtiMIIH +# cTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCB +# iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMp +# TWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEw +# OTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UE +# CBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9z +# b2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQ +# Q0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIh +# C3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNx +# WuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFc +# UTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAc +# nVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUo +# veO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyzi +# YrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9 +# fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdH +# GO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7X +# KHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiE +# R9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/ +# eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3 +# FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAd +# BgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEE +# AYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMI +# MBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMB +# Af8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1Ud +# HwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3By +# b2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQRO +# MEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2Vy +# dHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4IC +# AQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pk +# bHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gng +# ugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3 +# lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHC +# gRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6 +# MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEU +# BHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvsh +# VGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+ +# fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrp +# NPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHI +# qzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAs4wggI3AgEBMIH4 +# oYHQpIHNMIHKMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUw +# IwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjoxMkJDLUUzQUUtNzRFQjElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAG3F2jO4LEMVLwgKG +# XdYMN4FBgOCggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOXvuD8wIhgPMjAyMjAzMzExMzE4NTVaGA8yMDIyMDQw +# MTEzMTg1NVowdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e+4PwIBADAKAgEAAgIP +# IwIB/zAHAgEAAgIRnzAKAgUA5fEJvwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBANc53MLryLt1FD+jkakQydkemUps4QiN8HJxJ36VPuc2XRhvcn0Fhp1Pi8Hk +# gg08sFJoJ2vT/9g5J39zdjQpnbNGMkfmEi+qT6hbGq0ta5rnt1wDG2pVMuMn7N2Q +# 8CytKi6ZynWVbiCNuQtxsuwdgM7bRwcf510Wwp7iQUeNjJZzMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGhAYVVmblUXYoA +# AQAAAaEwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQg7aLPwq2FhUC9oleuUeRc4uk9d+4UFLvls0ps +# 5tQU14wwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCDrCFTxOoGCaCCCjoRy +# Be1JSQrMJeCCTyErziiJ347QhDCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABoQGFVZm5VF2KAAEAAAGhMCIEIOKn52EgS+EFhqx/FxY8 +# xYD6qqUYqtVZ3iZ47g3sjJRaMA0GCSqGSIb3DQEBCwUABIICACJi4QGIi9yhn8uf +# NlWbdGQNP0UkTWxJRMnAe4eQUYbcHoOxPxguwy7r8VfTZOdKBxfy7/LKo5XGmAo2 +# hmZSsLHjtT0zzkZti2AFeCRmZ8DMVaGfR9sWBr0OwlRS3HMDigpWyI5jP/tD529k +# jh0/BYwKg2TGRk6ZmdFWXuQf0lVb/LytEUyFbziq4hoxhKc4IQ3oCcOm1xaVZzbe +# SgzPg3j4QfHAucYgfxJoIUP1lKTRclmUc2ERYmHchaUxeYIdiDHx5lpEdNsh0acm +# LgV307ncxLeN1Ih2E6By+Dknm8OppqVYOSvcjcjqHY+fU7ci/FuvyUVDQv6xe2ZS +# K6qCMCrPWtoOlE3ms+LE5kHVQ1JOs0v7mVVP8xfO+fkArk3RuUl/1gaGxi5Ljheg +# l+51jV5PMM4Vha9KoWfU2306ZLt/I1Rftq1sCOD5ysLnhTQuInQMRpfXlY/rvTPu +# 9jzQ4q4Ty7WPp004gh+9hLIm0s0nmZmM8jyTRUFrK1SfHglBOKgdrcuJfmEuPKxL +# foRg/LzuUjcXvdtO3oozIaVWsTxGx6laY2DkMPnqYaj/oBwla86bNyQT94YTTGWq +# 3mCwt0/H4E3Mn1OXLVIGO3NrzZwTFFN2uqRmcTQ0AKiXU3ar4b8F/ykpQOvTV6x/ +# U7Jz/JaISbEvO3mUarzheUPqVmWq +# SIG # End signature block diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 new file mode 100644 index 000000000000..67107181add7 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 @@ -0,0 +1,375 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 03/31/2022 09:26:49 +# + +$PSDefaultParameterValues.Clear() +Set-StrictMode -Version Latest + +function Test-DotNet +{ + try + { + if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 }))) + { + throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher." + } + } + catch [System.Management.Automation.DriveNotFoundException] + { + Write-Verbose ".NET Framework version check failed." + } +} + +function Preload-Assembly { + param ( + [string] + $AssemblyDirectory + ) + if($PSEdition -eq 'Desktop' -and (Test-Path $AssemblyDirectory -ErrorAction Ignore)) + { + try + { + Get-ChildItem -ErrorAction Stop -Path $AssemblyDirectory -Filter "*.dll" | ForEach-Object { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + catch {} + } +} + +if ($true -and ($PSEdition -eq 'Desktop')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'5.1') + { + throw "PowerShell versions lower than 5.1 are not supported in Az. Please upgrade to PowerShell 5.1 or higher." + } + + Test-DotNet +} + +if ($true -and ($PSEdition -eq 'Core')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'6.2.4') + { + throw "Current Az version doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher." + } + if ($PSVersionTable.PSVersion -lt [Version]'7.0.6') + { + Write-Warning "This version of Az.Accounts is only supported on Windows PowerShell 5.1 and PowerShell 7.0.6 or greater, open https://aka.ms/install-powershell to learn how to upgrade. For further information, go to https://aka.ms/azpslifecycle." + } +} + +if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "PreloadAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +$netCorePath = (Join-Path $PSScriptRoot -ChildPath "NetCoreAssemblies") +if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore)) +{ + try + { + $loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object {New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} ) + Get-ChildItem -ErrorAction Stop -Path $netCorePath -Filter "*.dll" | ForEach-Object { + $assemblyName = ([System.Reflection.AssemblyName]::GetAssemblyName($_.FullName)) + $matches = ($loadedAssemblies | Where-Object {$_.Name -eq $assemblyName.Name}) + if (-not $matches) + { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + } + catch {} +} + + +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll) + + +if (Test-Path -Path "$PSScriptRoot\PostImportScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\PostImportScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +$FilteredCommands = @() + +if ($Env:ACC_CLOUD -eq $null) +{ + $FilteredCommands | ForEach-Object { + + $existingDefault = $false + foreach ($key in $global:PSDefaultParameterValues.Keys) + { + if ($_ -like "$key") + { + $existingDefault = $true + } + } + + if (!$existingDefault) + { + $global:PSDefaultParameterValues.Add($_, + { + if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null) + { + $context = Get-AzureRmContext + } + else + { + $context = Get-AzContext + } + if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) { + $context.ExtendedProperties["Default Resource Group"] + } + }) + } + } +} + +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBnXoRblwqGgp4a +# USzJaf5Wf+Tu+eUWmfecChJ7ENNasaCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgqwm8h/dw +# FED0y+xGCWSaD8Fc1mZMgPkryh2zfSvZwxIwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBvXNrKAkE7o84rJI6+XFvnA65dqlWCZBeFhG6YGpde +# Nom1mPdcfauabmxLKg7N5GG1FBWXuYDu1aEyDhiXzPG6ET+/ikXTGfN9J0D9g5Wx +# a2SeSIJ0XfsllBKKwOKl4OhoY3y5Kjjk08Cw75aE5BR8Ux0FWciN8n+nztakOyN9 +# tf7I5nmgbrHvJC5az2N9aR5DejRvjPDcNCnRkepz3nnA+FQNFbXaKqjgJz9oRBgA +# K2SAZDQnnK3B3MAv7qJX6GyeUhen7kwXZC0OV2RjyPRC+f8SiV/OF/ZsaFe4nXps +# RJqg5f5sUjCHFS5g8yK9Zy6D7EZKJJA4yk8YgRpdxOiuoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIAn/Ph2Du7oUABZfi9Z4pWXxedNUse800UpCJBeG +# +id6AgZiF5hUHpsYEzIwMjIwMzMxMTAwMDEyLjU2OFowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046RkM0MS00QkQ0LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY5Z20YAqBCU +# zAABAAABjjANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkZDNDEtNEJENC1EMjIwMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqiMCq6OM +# zLa5wrtcf7Bf9f1WXW9kpqbOBzgPJvaGLrZG7twgwqTRWf1FkjpJKBOG5QPIRy7a +# 6IFVAy0W+tBaFX4In4DbBf2tGubyY9+hRU+hRewPJH5CYOvpPh77FfGM63+OlwRX +# p5YER6tC0WRKn3mryWpt4CwADuGv0LD2QjnhhgtRVidsiDnn9+aLjMuNapUhstGq +# Cr7JcQZt0ZrPUHW/TqTJymeU1eqgNorEbTed6UQyLaTVAmhXNQXDChfa526nW7RQ +# 7L4tXX9Lc0oguiCSkPlu5drNA6NM8z+UXQOAHxVfIQXmi+Y3SV2hr2dcxby9nlTz +# Yvf4ZDr5Wpcwt7tTdRIJibXHsXWMKrmOziliGDToLx34a/ctZE4NOLnlrKQWN9ZG +# +Ox5zRarK1EhShahM0uQNhb6BJjp3+c0eNzMFJ2qLZqDp2/3Yl5Q+4k+MDHLTipP +# 6VBdxcdVfd4mgrVTx3afO5KNfgMngGGfhSawGraRW28EhrLOspmIxii92E7vjncJ +# 2tcjhLCjBArVpPh3cZG5g3ZVy5iiAaoDaswpNgnMFAK5Un1reK+MFhPi9iMnvUPw +# tTDDJt5YED5DAT3mBUxp5QH3t7RhZwAJNLWLtpTeGF7ub81sSKYv2ardazAe9XLS +# 10tV2oOPrcniGJzlXW7VPvxqQNxe8lCDA20CAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBTsQfkz9gT44N/5G8vNHayep+aV5DAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1UK9xzIeTlKhSbLn0bekR5gYh +# 6bB1XQpluCqCA15skZ37UilaFJw8+GklDLzlNhSP2mOiOzVyCq8kkpqnfUc01ZaB +# ezQxg77qevj2iMyg39YJfeiCIhxYOFugwepYrPO8MlB/oue/VhIiDb1eNYTlPSmv +# 3palsgtkrb0oo0F0uWmX4EQVGKRo0UENtZetVIxa0J9DpUdjQWPeEh9cEM+RgE26 +# 5w5WAVb+WNx0iWiF4iTbCmrWaVEOX92dNqBm9bT1U7nGwN5CygpNAgEaYnrTMx1N +# 4AjxObACDN5DdvGlu/O0DfMWVc6qk6iKDFC6WpXQSkMlrlXII/Nhp+0+noU6tfEp +# HKLt7fYm9of5i/QomcCwo/ekiOCjYktp393ovoC1O2uLtbLnMVlE5raBLBNSbINZ +# 6QLxiA41lXnVVLIzDihUL8MU9CMvG4sdbhk2FX8zvrsP5PeBIw1faenMZuz0V3UX +# CtU5Okx5fmioWiiLZSCi1ljaxX+BEwQiinCi+vE59bTYI5FbuR8tDuGLiVu/JSpV +# FXrzWMP2Kn11sCLAGEjqJYUmO1tRY29Kd7HcIj2niSB0PQOCjYlnCnywnDinqS1C +# XvRsisjVlS1Rp4Tmuks+pGxiMGzF58zcb+hoFKyONuL3b+tgxTAz3sF3BVX9uk9M +# 5F+OEoeyLyGfLekNAjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046RkM0MS00QkQ0 +# LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAD1iK+pPThHqgpa5xsPmiYruWVuMoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl75AOMCIY +# DzIwMjIwMzMxMTAyNzI2WhgPMjAyMjA0MDExMDI3MjZaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvkA4CAQAwCgIBAAICAYUCAf8wBwIBAAICEiowCgIFAOXw4Y4C +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQCCQ+gyinUAzBfQG0tdRLTKoWAz +# 1F9XL8HUl1+DL/nO5fnfNT2fIwdNtkcnjXkY7J89nDVJ5orczCc/Jjd8FWrGsZYF +# R7jTDpEnctly2mdeOC54DPn8NfB2rKnTAZSMNZUA5+qwXYtBJ9/L+zBcWbLJGn17 +# Xdsy6ogPG2mqiNeJETGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjlnbRgCoEJTMAAEAAAGOMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIBdm +# /Yr/algho7Se4sS1u0RA1CsQ3avLfVkP9cSuIl4vMIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgvQWPITvigaUuV5+f/lWs3BXZwJ/l1mf+yelu5nXmxCUwgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY5Z20YAqBCU +# zAABAAABjjAiBCDFYh4a5uyi794y1CHlKx3P8nxZO/8fomUMsnns7kvKmzANBgkq +# hkiG9w0BAQsFAASCAgCphAx90HI/vzWSwneRSNg3gV826YqxCNSVkzMDcu1Rkayq +# 3FhK466ELhIxyI9EL3hLCS/BIQYKH8AiVU85P07pmaLls+bUM2CPt3II0oZYY5T8 +# BN/MyqZ0vUS6QvNX8ZT8A82R5/meSt8qS8+8ppG1XumAYmdqv7vriD8ENBrhIyus +# 3Wjwt0rS2kovNj+6g3xMJBU+LnP+qzNv72aEr2LvKkU8/abYiNXN1FGlJPqHYrF/ +# zumVFsNkJMjJrlgRFlo/EROGu3iUiI37hM7mTm77aYrWoMbKrl/4nKfMpjR4KQqL +# Mhi9Cb1c11cugxCFnoc1IA6kQ+Xg1fYUchz5UmgzDTpwic3FVGGRlTv4Wf9PMjjj +# heZyL7BFkHZCpr5qpwpu/ZvpCSQpsP4Aa07qY5ffgRu/te0ip3gkzL3Ur7zNqf60 +# Dw9If1ECZOcx+GMgIHd0t+48+hsE4RrmvMvWrEBz2B/BJEOfrIQEClhFczLjDd4G +# nhh4y/vSlqbUUupH+/oJRtpla+ZQbAxsg8jTPsiGG7hmvSaNfV7+SgwCjO1HB/On +# DkzS+edyqivrfkuwjFYecbLcl9e9Pr3SPFvelW5kXiQw2KyWFrD0aznq7YT0x/Na +# /XaZDuLepRVe7YnvH4Ky7yk58zG3QYNy5EJ6Pf3ClNsX4BBAJsUrWMxicmpUDg== +# SIG # End signature block diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..32652d6de4d0 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..81b736cc09da Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..f656e5e42360 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..92d06762d6a5 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..8e791611cc1a Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json new file mode 100644 index 000000000000..dde9337e5748 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json @@ -0,0 +1,2309 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..fcc5eb26eb20 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json new file mode 100644 index 000000000000..7828816a6777 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json @@ -0,0 +1,2273 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..511cf6f6e630 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json new file mode 100644 index 000000000000..ce563dfdebbe --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json @@ -0,0 +1,1316 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v2.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v2.1": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netcoreapp2.1/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "System.Collections/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": {}, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": {}, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": {}, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "path": "microsoft.csharp/4.3.0", + "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..239999aa2f3c Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..d966f6c302c5 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..2667669dd3f4 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..a11687928f60 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..78fd60ad7aeb Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b33058d94c53 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..e07270d24805 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..6f489252bcac Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..c19efdb8e00b Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..0d443a2ecaaa Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..482ccf22b352 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..4bf3ee9bd78d Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json new file mode 100644 index 000000000000..54274e52ee76 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json @@ -0,0 +1,2413 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Authentication.ResourceManager": "1.0.0", + "Microsoft.Azure.PowerShell.Authenticators": "1.0.0", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0", + "System.Security.Permissions": "4.5.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.AccessControl/4.5.0": { + "dependencies": { + "System.Security.Principal.Windows": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Permissions/4.5.0": { + "dependencies": { + "System.Security.AccessControl": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Permissions.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Principal.Windows/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "dependencies": { + "Azure.Identity": "1.5.0", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authenticators.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.AccessControl/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==", + "path": "system.security.accesscontrol/4.5.0", + "hashPath": "system.security.accesscontrol.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.Permissions/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==", + "path": "system.security.permissions/4.5.0", + "hashPath": "system.security.permissions.4.5.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", + "path": "system.security.principal.windows/4.5.0", + "hashPath": "system.security.principal.windows.4.5.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..2eff02a0138e Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..85f85750523b --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,11900 @@ + + + + + Add-AzEnvironment + Add + AzEnvironment + + Adds endpoints and metadata for an instance of Azure Resource Manager. + + + + The Add-AzEnvironment cmdlet adds endpoints and metadata to enable Azure Resource Manager cmdlets to connect with a new instance of Azure Resource Manager. The built-in environments AzureCloud and AzureChinaCloud target existing public instances of Azure Resource Manager. + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + AutoDiscover + + Discovers environments via default or configured endpoint. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AutoDiscover + + Discovers environments via default or configured endpoint. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : +VersionProfiles : {} +ExtendedProperties : {} +BatchEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + ------- Example 2: Discovering a new environment via Uri ------- + <# +Uri https://configuredmetadata.net returns an array of environment metadata. The following example contains a payload for the AzureCloud default environment. + +[ + { + "portal": "https://portal.azure.com", + "authentication": { + "loginEndpoint": "https://login.microsoftonline.com/", + "audiences": [ + "https://management.core.windows.net/" + ], + "tenant": "common", + "identityProvider": "AAD" + }, + "media": "https://rest.media.azure.net", + "graphAudience": "https://graph.windows.net/", + "graph": "https://graph.windows.net/", + "name": "AzureCloud", + "suffixes": { + "azureDataLakeStoreFileSystem": "azuredatalakestore.net", + "acrLoginServer": "azurecr.io", + "sqlServerHostname": ".database.windows.net", + "azureDataLakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net", + "keyVaultDns": "vault.azure.net", + "storage": "core.windows.net", + "azureFrontDoorEndpointSuffix": "azurefd.net" + }, + "batch": "https://batch.core.windows.net/", + "resourceManager": "https://management.azure.com/", + "vmImageAliasDoc": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json", + "activeDirectoryDataLake": "https://datalake.azure.net/", + "sqlManagement": "https://management.core.windows.net:8443/", + "gallery": "https://gallery.azure.com/" + }, +…… +] +#> + +Add-AzEnvironment -AutoDiscover -Uri https://configuredmetadata.net + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + In this example, we are discovering a new Azure environment from the `https://configuredmetadata.net` Uri. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzContext + Clear + AzContext + + Remove all Azure credentials, account, and subscription information. + + + + Remove all Azure Credentials, account, and subscription information. + + + + Clear-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + --------------- Example 1: Clear global context --------------- + Clear-AzContext -Scope CurrentUser + + Remove all account, subscription, and credential information for any powershell session. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azcontext + + + + + + Clear-AzDefault + Clear + AzDefault + + Clears the defaults set by the user in the current context. + + + + The Clear-AzDefault cmdlet removes the defaults set by the user depending on the switch parameters specified by the user. + + + + Clear-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzDefault + + This command removes all the defaults set by the user in the current context. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzDefault -ResourceGroup + + This command removes the default resource group set by the user in the current context. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azdefault + + + + + + Connect-AzAccount + Connect + AzAccount + + Connect to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. + + + + The `Connect-AzAccount` cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. You can use this authenticated account only with Azure Resource Manager requests. To add an authenticated account for use with Service Management, use the `Add-AzureAccount` cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions. The list of contexts created for the user can be found by running `Get-AzContext -ListAvailable`. To skip this context population, specify the SkipContextPopulation switch parameter. After executing this cmdlet, you can disconnect from an Azure account using `Disconnect-AzAccount`. + + + + Connect-AzAccount + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + Identity + + Login using a Managed Service Identity. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + Identity + + Login using a Managed Service Identity. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------------ Example 1: Connect to an Azure account ------------ + Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 2: Connect to Azure using organizational ID credentials + $Credential = Get-Credential +Connect-AzAccount -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 3: Connect to Azure using a service principal account + $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecuredPassword +Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxx-xxxx-xxxx-xxxx Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 4: Use an interactive login to connect to a specific tenant and subscription + Connect-AzAccount -Tenant 'xxxx-xxxx-xxxx-xxxx' -SubscriptionId 'yyyy-yyyy-yyyy-yyyy' + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ----- Example 5: Connect using a Managed Service Identity ----- + Connect-AzAccount -Identity + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +MSI@50342 Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 6: Connect using Managed Service Identity login and ClientId + $identity = Get-AzUserAssignedIdentity -ResourceGroupName 'myResourceGroup' -Name 'myUserAssignedIdentity' +Get-AzVM -ResourceGroupName contoso -Name testvm | Update-AzVM -IdentityType UserAssigned -IdentityId $identity.Id +Connect-AzAccount -Identity -AccountId $identity.ClientId # Run on the virtual machine + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ------------ Example 7: Connect using certificates ------------ + $Thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = '00000000-0000-0000-0000-00000000' +Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + +Account : xxxxxxxx-xxxx-xxxx-xxxxxxxx +SubscriptionName : MyTestSubscription +SubscriptionId : zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz +TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy +Environment : AzureCloud + + + + + + + + -------------- Example 8: Connect with AuthScope -------------- + Connect-AzAccount -AuthScope Storage + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ---------- Example 9: Connect using certificate file ---------- + $securePassword = $plainPassword | ConvertTo-SecureString -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount + + + + + + Disable-AzContextAutosave + Disable + AzContextAutosave + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Disable-AzContextAutosave + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ---------- Example 1: Disable autosaving the context ---------- + Disable-AzContextAutosave + + Disable autosave for the current user. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azcontextautosave + + + + + + Disable-AzDataCollection + Disable + AzDataCollection + + Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default unless you explicitly opt out. + + + + The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell automatically collects telemetry data by default. To disable data collection, you must explicitly opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. If you've previously opted out, run the `Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current machine. + + + + Disable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -- Example 1: Disabling data collection for the current user -- + Disable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azdatacollection + + + Enable-AzDataCollection + + + + + + + Disable-AzureRmAlias + Disable + AzureRmAlias + + Disables AzureRm prefix aliases for Az modules. + + + + Disables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases disabled. Otherwise all AzureRm aliases are disabled. + + + + Disable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Disable-AzureRmAlias + + Disables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Disables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azurermalias + + + + + + Disconnect-AzAccount + Disconnect + AzAccount + + Disconnects a connected Azure account and removes all credentials and contexts associated with that account. + + + + The Disconnect-AzAccount cmdlet disconnects a connected Azure account and removes all credentials and contexts (subscription and tenant information) associated with that account. After executing this cmdlet, you will need to login again using Connect-AzAccount. + + + + Disconnect-AzAccount + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + + + + + + + ----------- Example 1: Logout of the current account ----------- + Disconnect-AzAccount + + Logs out of the Azure account associated with the current context. + + + + + + Example 2: Logout of the account associated with a particular context + Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser + + Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted. + + + + + + ------------- Example 3: Log out a particular user ------------- + Disconnect-AzAccount -Username 'user1@contoso.org' + + Logs out the 'user1@contoso.org' user - all credentials and all contexts associated with this user will be removed. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disconnect-azaccount + + + + + + Enable-AzContextAutosave + Enable + AzContextAutosave + + Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more information, see Azure PowerShell context objects (https://docs.microsoft.com/powershell/azure/context-persistence). + This cmdlet allows the Azure context information to be saved and automatically loaded when you start a PowerShell process. For example, when opening a new window. + + + + Allows the Azure context information to be saved and automatically loaded when a PowerShell process starts. The context is saved at the end of the execution of any cmdlet that affects the context. For example, any profile cmdlet. If you're using user authentication, then tokens can be updated during the course of running any cmdlet. + + + + Enable-AzContextAutosave + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + Example 1: Enable autosaving credentials for the current user + Enable-AzContextAutosave + + + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azcontextautosave + + + + + + Enable-AzDataCollection + Enable + AzDataCollection + + Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell cmdlets. Executing this cmdlet opts in to data collection for the current user on the current machine. Data is collected by default unless you explicitly opt out. + + + + The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell automatically collects telemetry data by default. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection, you must explicitly opt out by executing `Disable-AzDataCollection`. + + + + Enable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + --- Example 1: Enabling data collection for the current user --- + Enable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azdatacollection + + + Disable-AzDataCollection + + + + + + + Enable-AzureRmAlias + Enable + AzureRmAlias + + Enables AzureRm prefix aliases for Az modules. + + + + Enables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases enabled. Otherwise all AzureRm aliases are enabled. + + + + Enable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + + Local + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Enable-AzureRmAlias + + Enables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Enables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Get-AzAccessToken + Get + AzAccessToken + + Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. + + + + Get access token + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + + + + + + + + ------- Example 1 Get the access token for ARM endpoint ------- + Get-AzAccessToken + + Get access token of current account for ResourceManager endpoint + + + + + + - Example 2 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceTypeName MSGraph + + Get access token of Microsoft Graph endpoint for current account + + + + + + - Example 3 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" + + Get access token of Microsoft Graph endpoint for current account + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzContext + Get + AzContext + + Gets the metadata used to authenticate Azure Resource Manager requests. + + + + The Get-AzContext cmdlet gets the current metadata used to authenticate Azure Resource Manager requests. This cmdlet gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment. Azure Resource Manager cmdlets use these settings by default when making Azure Resource Manager requests. When the available amount of subscription exceeds the default limit of 25, some subscriptions may not show up in the results of `Get-AzContext -ListAvailable`. Please run `Connect-AzAccount -MaxContextPopulation <int>` to get more contexts. + + + + Get-AzContext + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + + System.Management.Automation.SwitchParameter + + + False + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + + System.Management.Automation.SwitchParameter + + + False + + + + Get-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + The name of the context + + System.String + + System.String + + + None + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------------ Example 1: Getting the current context ------------ + Connect-AzAccount +Get-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + In this example we are logging into our account with an Azure subscription using Connect-AzAccount, and then we are getting the context of the current session by calling Get-AzContext. + + + + + + ---------- Example 2: Listing all available contexts ---------- + Get-AzContext -ListAvailable + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... +Subscription2 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription2 AzureCloud xxxxxxxx-x... +Subscription3 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription3 AzureCloud xxxxxxxx-x... + + In this example, all currently available contexts are displayed. The user may select one of these contexts using Select-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontext + + + Set-AzContext + + + + Connect-AzAccount + + + + + + + Get-AzContextAutosaveSetting + Get + AzContextAutosaveSetting + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Get-AzContextAutosaveSetting + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ------ Get context save metadata for the current session ------ + Get-AzContextAutosaveSetting + +Mode : Process +ContextDirectory : None +ContextFile : None +CacheDirectory : None +CacheFile : None +Settings : {} + + Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled. + + + + + + -------- Get context save metadata for the current user -------- + Get-AzContextAutosaveSetting -Scope CurrentUser + +Mode : CurrentUser +ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +ContextFile : AzureRmContext.json +CacheDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +CacheFile : TokenCache.dat +Settings : {} + + Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default location. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontextautosavesetting + + + + + + Get-AzDefault + Get + AzDefault + + Get the defaults set by the user in the current context. + + + + The Get-AzDefault cmdlet gets the Resource Group that the user has set as default in the current context. + + + + Get-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzDefault + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current defaults if there are defaults set, or returns nothing if no default is set. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzDefault -ResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current default Resource Group if there is a default set, or returns nothing if no default is set. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. + + + + The Get-AzEnvironment cmdlet gets endpoints and metadata for an instance of Azure services. + + + + Get-AzEnvironment + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ---------- Example 1: Getting all Azure environments ---------- + Get-AzEnvironment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in +AzureGermanCloud https://management.microsoftazure.de/ https://login.microsoftonline.de/ Built-in +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in +AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + -------- Example 2: Getting the AzureCloud environment -------- + Get-AzEnvironment -Name AzureCloud + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + ------ Example 3: Getting the AzureChinaCloud environment ------ + Get-AzEnvironment -Name AzureChinaCloud | Format-List + +Name : AzureChinaCloud +Type : Built-in +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : https://management.core.chinacloudapi.cn/ +AdTenant : Common +GalleryUrl : https://gallery.azure.com/ +ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=301902 +ServiceManagementUrl : https://management.core.chinacloudapi.cn/ +PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301776 +ResourceManagerUrl : https://management.chinacloudapi.cn/ +SqlDatabaseDnsSuffix : .database.chinacloudapi.cn +StorageEndpointSuffix : core.chinacloudapi.cn +ActiveDirectoryAuthority : https://login.chinacloudapi.cn/ +GraphUrl : https://graph.chinacloudapi.cn/ +GraphEndpointResourceId : https://graph.chinacloudapi.cn/ +TrafficManagerDnsSuffix : trafficmanager.cn +AzureKeyVaultDnsSuffix : vault.azure.cn +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : https://vault.azure.cn +ContainerRegistryEndpointSuffix : azurecr.cn +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : asazure.chinacloudapi.cn +AnalysisServicesEndpointResourceId : https://region.asazure.chinacloudapi.cn +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : dev.azuresynapse.azure.cn +AzureSynapseAnalyticsEndpointResourceId : https://dev.azuresynapse.azure.cn + + This example shows how to get the endpoints and metadata for the AzureChinaCloud environment. + + + + + + ----- Example 4: Getting the AzureUSGovernment environment ----- + Get-AzEnvironment -Name AzureUSGovernment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in + + This example shows how to get the endpoints and metadata for the AzureUSGovernment environment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azenvironment + + + Add-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Get-AzSubscription + Get + AzSubscription + + Get subscriptions that the current account can access. + + + + The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access. + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + + + + + ------- Example 1: Get all subscriptions in all tenants ------- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled +Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enabled + + This command gets all subscriptions in all tenants that are authorized for the current account. + + + + + + ---- Example 2: Get all subscriptions for a specific tenant ---- + Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa" + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + List all subscriptions in the given tenant that are authorized for the current account. + + + + + + ---- Example 3: Get all subscriptions in the current tenant ---- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + This command gets all subscriptions in the current tenant that are authorized for the current user. + + + + + + Example 4: Change the current context to use a specific subscription + Get-AzSubscription -SubscriptionId "xxxx-xxxx-xxxx-xxxx" -TenantId "yyyy-yyyy-yyyy-yyyy" | Set-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxx-xxxx-xxxx-xxxx) azureuser@micros... Subscription1 AzureCloud yyyy-yyyy-yyyy-yyyy + + This command gets the specified subscription, and then sets the current context to use it. All subsequent cmdlets in this session use the new subscription (Contoso Subscription 1) by default. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azsubscription + + + + + + Get-AzTenant + Get + AzTenant + + Gets tenants that are authorized for the current user. + + + + The Get-AzTenant cmdlet gets tenants authorized for the current user. + + + + Get-AzTenant + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + + + + + + + ---------------- Example 1: Getting all tenants ---------------- + Connect-AzAccount +Get-AzTenant + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} +yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com + + This example shows how to get all of the authorized tenants of an Azure account. + + + + + + ------------- Example 2: Getting a specific tenant ------------- + Connect-AzAccount +Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} + + This example shows how to get a specific authorized tenant of an Azure account. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzContext + Import + AzContext + + Loads Azure authentication information from a file. + + + + The Import-AzContext cmdlet loads authentication information from a file to set the Azure environment and context. Cmdlets that you run in the current session use this information to authenticate requests to Azure Resource Manager. + + + + Import-AzContext + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Import-AzContext + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ----- Example 1: Importing a context from a AzureRmProfile ----- + Import-AzContext -AzContext (Connect-AzAccount) + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example imports a context from a PSAzureProfile that is passed through to the cmdlet. + + + + + + ------- Example 2: Importing a context from a JSON file ------- + Import-AzContext -Path C:\test.json + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example selects a context from a JSON file that is passed through to the cmdlet. This JSON file can be created from Save-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/import-azcontext + + + + + + Invoke-AzRestMethod + Invoke + AzRestMethod + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Invoke-AzRestMethod + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.string + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSHttpResponse + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : { + "properties": { + "source": "Azure", + "customerId": "{customerId}", + "provisioningState": "Succeeded", + "sku": { + "name": "pergb2018", + "maxCapacityReservationLevel": 3000, + "lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT" + }, + "retentionInDays": 30, + "features": { + "legacy": 0, + "searchVersion": 1, + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1.0, + "quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT", + "dataIngestionStatus": "RespectQuota" + }, + "enableFailover": false, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled", + "createdDate": "Mon, 25 May 2020 11:10:01 GMT", + "modifiedDate": "Mon, 25 May 2020 11:10:02 GMT" + }, + "id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}", + "name": "{workspace}", + "type": "Microsoft.OperationalInsights/workspaces", + "location": "eastasia", + "tags": {} + } + + Get log analytics workspace by path. It only supports management plane API and Hostname of Azure Resource Manager is added according to Azure environment setting. + + + + + + + -------------------------- Example 2 -------------------------- + Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me + +Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......} + + Get current signed in user via MicrosoftGraph API. This example is equivalent to `Get-AzADUser -SignedIn`. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/invoke-azrestmethod + + + + + + Open-AzSurveyLink + Open + AzSurveyLink + + Open survey link in default browser. + + + + Open survey link in default browser. + + + + Open-AzSurveyLink + + + + + + + None + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Open-AzSurveyLink + +Opening the default browser to https://aka.ms/azpssurvey?Q_CHL=INTERCEPT + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/open-azsurveylink + + + + + + Register-AzModule + Register + AzModule + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + Register-AzModule + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Register-AzModule + + Used Internally by AutoRest-generated cmdlets + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/register-azmodule + + + + + + Remove-AzContext + Remove + AzContext + + Remove a context from the set of available contexts + + + + Remove an azure context from the set of contexts + + + + Remove-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Remove-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + PassThru + + Return the removed context + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AzContext -Name Default + + Remove the context named default + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azcontext + + + + + + Remove-AzEnvironment + Remove + AzEnvironment + + Removes endpoints and metadata for connecting to a given Azure instance. + + + + The Remove-AzEnvironment cmdlet removes endpoints and metadata information for connecting to a given Azure instance. + + + + Remove-AzEnvironment + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and removing a test environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Remove-AzEnvironment -Name TestEnvironment + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + This example shows how to create an environment using Add-AzEnvironment, and then how to delete the environment using Remove-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Rename-AzContext + Rename + AzContext + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename-AzContext + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Rename-AzContext + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------ Example 1: Rename a context using named parameters ------ + Rename-AzContext -SourceName "[user1@contoso.org; 12345-6789-2345-3567890]" -TargetName "Work" + + Rename the context for 'user1@contoso.org' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using 'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion. + + + + + + --- Example 2: Rename a context using positional parameters --- + Rename-AzContext "My context" "Work" + + Rename the context named "My context" to "Work". After this command, you will be able to target the context using Select-AzContext Work + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/rename-azcontext + + + + + + Resolve-AzError + Resolve + AzError + + Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors. + + + + Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including complete detail about the request and server response that caused the error. + + + + Resolve-AzError + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + Resolve-AzError + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Last + + Resolve only the last error that occurred in the session. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + Last + + Resolve only the last error that occurred in the session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.ErrorRecord[] + + + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + + + + + + + + + -------------- Example 1: Resolve the Last Error -------------- + Resolve-AzError -Last + +HistoryId: 3 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 3 + + Get details of the last error. + + + + + + --------- Example 2: Resolve all Errors in the Session --------- + Resolve-AzError + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + + HistoryId: 5 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur + e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in + C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin + e 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p + owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure- + powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 5 + + Get details of all errors that have occurred in the current session. + + + + + + ------------- Example 3: Resolve a Specific Error ------------- + Resolve-AzError $Error[0] + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + Get details of the specified error. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/resolve-azerror + + + + + + Save-AzContext + Save + AzContext + + Saves the current authentication information for use in other PowerShell sessions. + + + + The Save-AzContext cmdlet saves the current authentication information for use in other PowerShell sessions. + + + + Save-AzContext + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------- Example 1: Saving the current session's context ------- + Connect-AzAccount +Save-AzContext -Path C:\test.json + + This example saves the current session's Azure context to the JSON file provided. + + + + + + -------------- Example 2: Saving a given context -------------- + Save-AzContext -Profile (Connect-AzAccount) -Path C:\test.json + + This example saves the Azure context that is passed through to the cmdlet to the JSON file provided. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/save-azcontext + + + + + + Select-AzContext + Select + AzContext + + Select a subscription and account to target in Azure PowerShell cmdlets + + + + Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected context. + + + + Select-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Select-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------- Example 1: Target a named context -------------- + Select-AzContext "Work" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/select-azcontext + + + + + + Send-Feedback + Send + Feedback + + Sends feedback to the Azure PowerShell team via a set of guided prompts. + + + + The Send-Feedback cmdlet sends feedback to the Azure PowerShell team. + + + + Send-Feedback + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1: -------------------------- + Send-Feedback + +With zero (0) being the least and ten (10) being the most, how likely are you to recommend Azure PowerShell to a friend or colleague? + +10 + +What does Azure PowerShell do well? + +Response. + +Upon what could Azure PowerShell improve? + +Response. + +Please enter your email if you are interested in providing follow up information: + +your@email.com + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/send-feedback + + + + + + Set-AzContext + Set + AzContext + + Sets the tenant, subscription, and environment for cmdlets to use in the current session. + + + + The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information. + + + + Set-AzContext + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ----------- Example 1: Set the subscription context ----------- + Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + This command sets the context to use the specified subscription. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azcontext + + + Get-AzContext + + + + + + + Set-AzDefault + Set + AzDefault + + Sets a default in the current context + + + + The Set-AzDefault cmdlet adds or changes the defaults in the current context. + + + + Set-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-AzDefault -ResourceGroupName myResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command sets the default resource group to the resource group specified by the user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azdefault + + + + + + Set-AzEnvironment + Set + AzEnvironment + + Sets properties for an Azure environment. + + + + The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an instance of Azure. + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +BatchEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureOperationalInsightsEndpointResourceId : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + + + + Uninstall-AzureRm + Uninstall + AzureRm + + Removes all AzureRm modules from a machine. + + + + Removes all AzureRm modules from a machine. + + + + Uninstall-AzureRm + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Uninstall-AzureRm + + Running this command will remove all AzureRm modules from the machine for the version of PowerShell in which the cmdlet is run. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..e45ac91a1264 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..a705c3fd25a8 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..f15127c61779 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..f82770a9ceed Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..4b4be00999a4 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..bb0bc9e63f5d --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,219 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgLwxfLTEa +# f5cZ43nGFJSGxV1AZMu24c5Ln5TdSBDWTncwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCH+MB7uS3RlpbV8q8Nvg9aa0UmWWYCFOT/3n7V09Q6 +# p3v/uFdZ8AXCe8zdAeWFwLOQg9974QcDbIbvXm1V96+Z7zEEimU/Zr1ou5Cv0knI +# riaKdejplgnDt1EnBE9JlSyVsV7aOYr4EueMCb1Xn1dfGabKcgVlJUlP0JyZPQfs +# YqsyxEznkgNE769m8ozUwCx33jJN1Llcs3FYEe5irzu8UthSkFQ8vpG3YABhlk6M +# 4jPeb38LKbkEE0jclq6sfdmT+JL8j7Z05KfgaD076LnpSaqkcu9+2RH3TARosqhq +# I/N3nhDQclKIl1kYSXFG1E4/6ea3rAa98adIaR0YNcpFoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIDsI/xX4lqk74CTV97lUQ0iyAOiIu4ggTwVzbGvl +# +HKeAgZiMTFcH0UYEzIwMjIwMzMxMTAwMDA5LjQ1OVowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY16VS54dJkq +# twABAAABjTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkEyNDAtNEI4Mi0xMzBFMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2jRILZg+ +# O6U7dLcuwBPMB+0tJUz0wHLqJ5f7KJXQsTzWToADUMYV4xVZnp9mPTWojUJ/l3O4 +# XqegLDNduFAObcitrLyY5HDsxAfUG1/2YilcSkSP6CcMqWfsSwULGX5zlsVKHJ7t +# vwg26y6eLklUdFMpiq294T4uJQdXd5O7mFy0vVkaGPGxNWLbZxKNzqKtFnWQ7jMt +# Z05XvafkIWZrNTFv8GGpAlHtRsZ1A8KDo6IDSGVNZZXbQs+fOwMOGp/Bzod8f1YI +# 8Gb2oN/mx2ccvdGr9la55QZeVsM7LfTaEPQxbgAcLgWDlIPcmTzcBksEzLOQsSpB +# zsqPaWI9ykVw5ofmrkFKMbpQT5EMki2suJoVM5xGgdZWnt/tz00xubPSKFi4B4IM +# FUB9mcANUq9cHaLsHbDJ+AUsVO0qnVjwzXPYJeR7C/B8X0Ul6UkIdplZmncQZSBK +# 3yZQy+oGsuJKXFAq3BlxT6kDuhYYvO7itLrPeY0knut1rKkxom+ui6vCdthCfnAi +# yknyRC2lknqzz8x1mDkQ5Q6Ox9p6/lduFupSJMtgsCPN9fIvrfppMDFIvRoULsHO +# dLJjrRli8co5M+vZmf20oTxYuXzM0tbRurEJycB5ZMbwznsFHymOkgyx8OeFnXV3 +# car45uejI1B1iqUDbeSNxnvczuOhcpzwackCAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBR4zJFuh59GwpTuSju4STcflihmkzAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1r3Oz0lEq3VvpdFlh3YBxc4hn +# YkALyYPDa9FO4XgqwkBm8Lsb+lK3tbGGgpi6QJbK3iM3BK0ObBcwRaJVCxGLGtr6 +# Jz9hRumRyF8o4n2y3YiKv4olBxNjFShSGc9E29JmVjBmLgmfjRqPc/2rD25q4ow4 +# uA3rc9ekiaufgGhcSAdek/l+kASbzohOt/5z2+IlgT4e3auSUzt2GAKfKZB02ZDG +# WKKeCY3pELj1tuh6yfrOJPPInO4ZZLW3vgKavtL8e6FJZyJoDFMewJ59oEL+AK3e +# 2M2I4IFE9n6LVS8bS9UbMUMvrAlXN5ZM2I8GdHB9TbfI17Wm/9Uf4qu588PJN7vC +# Jj9s+KxZqXc5sGScLgqiPqIbbNTE+/AEZ/eTixc9YLgTyMqakZI59wGqjrONQSY7 +# u0VEDkEE6ikz+FSFRKKzpySb0WTgMvWxsLvbnN8ACmISPnBHYZoGssPAL7foGGKF +# LdABTQC2PX19WjrfyrshHdiqSlCspqIGBTxRaHtyPMro3B/26gPfCl3MC3rC3NGq +# 4xGnIHDZGSizUmGg8TkQAloVdU5dJ1v910gjxaxaUraGhP8IttE0RWnU5XRp/sGa +# NmDcMwbyHuSpaFsn3Q21OzitP4BnN5tprHangAC7joe4zmLnmRnAiUc9sRqQ2bms +# MAvUpsO8nlOFmiM1LzCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046QTI0MC00Qjgy +# LTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAIBzlZM9TRND4PgtpLWQZkSPYVcJoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl73XWMCIY +# DzIwMjIwMzMxMDgzNTM0WhgPMjAyMjA0MDEwODM1MzRaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvddYCAQAwCgIBAAICF6kCAf8wBwIBAAICER8wCgIFAOXwx1YC +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQAY60kde7HWABLbM75dgVqLPwu2 +# UX3qQDaoStTqkS7953pYHKc6GEqRd/nLCCeYBqC+XJRMTMNbd4ZDkkCzsxlr5HFi +# GE6eT7+KvwqQf+djK59ZAts0no9RPZcdCJwQfvqU3RK91gp/Sg2bCMvAfTN4LRGp +# qQ4tYYP2GrJJNqVbkDGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3AAEAAAGNMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIOQz +# W64DlGXuO2zRgqB/n+gyoReL9ldfVdiKRVTSCDK+MIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgnpYRM/odXkDAnzf2udL569W8cfGTgwVuenQ8ttIYzX8wgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY16VS54dJkq +# twABAAABjTAiBCCgvCueU3dRfCsOKSpG5oksOx2/8SHFEjSLBygedl9oUzANBgkq +# hkiG9w0BAQsFAASCAgASDKu2OAv74hH075B2jN90FtXMtuST3zF61GC5OXm38b4j +# NSjLjbMslJJqeXiyODEQFNxmdE9AgPguQK13CeNnqsx2krlMfIC4o+M2pN7lqWCk +# gWfp5QemsmucuotA2dXLF98jGlQ1JShvFVOvUyxs0QKejf323B/mYdoUzvKurP1M +# k+FUjq/w3mgN9oj5oHoCIkdg1gDWNh80zEa0/YxEE7YYzg8bPLsGpK+f7B75Q51Y +# Sz7Gp/LGpQiG/LjytNQmsHwy/bl3FCr5/2WxBkAs8BneisPIfNLW0gfEo5Azkjo9 +# KEm5l8ILkJ3/4Qx9HiGjqwrdto8kGWAlGoIELtsO0BGT4onF4ynlKQgw82JK+4RD +# tWXCnPqjojkl+/4tfbeEdUoPvNgYpvS6ZRRYJIWg5s7XViroohZCCSkqt8aMjTZF +# HJBsKzmdHvVvAGELQ7TKaN3mOMUXb/o4vIK0TYrYN6FUn5iVnA7X2LIbJj0j3Mef +# BwEeOFhSjxz2Ob1oihNBoR1v5y+XfkbT7igIVQqwM27ujcOooOsDkpgizs0FajJV +# jeRsqEsXgfpaKCAq5czpOTutrvvwEn/cINrR3JW1TRSGt3VUvSWkmBs1T+7Oj6H6 +# ewWQaQIDYdEiDUL8OJhl+GzebujxPo//NXTY0MZCxK3DXhXi5okwsImzh5010w== +# SIG # End signature block diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..67edb79248ca Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..869ac1b86c57 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..d22ddefa2339 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7f392562319f Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll new file mode 100644 index 000000000000..6344999edbb3 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9b0ae142146e Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..a2b54fb042de Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..5aa381018c00 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..64a57cbbecce Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..0c27a0e21c7e Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll new file mode 100644 index 000000000000..e8074324cd13 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll new file mode 100644 index 000000000000..d1af38f0f8b7 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..afd187c14918 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..a3a85c2b7255 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..f234bd2dd7e5 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 @@ -0,0 +1,278 @@ +function Write-InstallationCheckToFile +{ + Param($installationchecks) + if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) + { + Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide") + } + + $installationchecks.Add("AzSideBySideCheck","true") + try + { + if (Test-Path $pathToInstallationChecks -ErrorAction Ignore) + { + Remove-Item -Path $pathToInstallationChecks -ErrorAction Stop + } + + $pathToInstallDir = Split-Path -Path $pathToInstallationChecks -Parent -ErrorAction Stop + if (Test-Path $pathToInstallDir -ErrorAction Ignore) + { + New-Item -Path $pathToInstallationChecks -ErrorAction Stop -ItemType File -Value ($installationchecks | ConvertTo-Json -ErrorAction Stop) + } + } + catch + { + Write-Verbose "Installation checks failed to write to file." + } +} + +if (!($env:SkipAzInstallationChecks -eq "true")) +{ + $pathToInstallationChecks = Join-Path (Join-Path $HOME ".Azure") "AzInstallationChecks.json" + $installationchecks = @{} + if (!(Test-Path $pathToInstallationChecks -ErrorAction Ignore)) + { + Write-InstallationCheckToFile $installationchecks + } + else + { + try + { + ((Get-Content $pathToInstallationChecks -ErrorAction Stop) | ConvertFrom-Json -ErrorAction Stop).PSObject.Properties | Foreach { $installationchecks[$_.Name] = $_.Value } + } + catch + { + Write-InstallationCheckToFile $installationchecks + } + + if (!$installationchecks.ContainsKey("AzSideBySideCheck")) + { + Write-InstallationCheckToFile $installationchecks + } + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Update-TypeData -AppendPath (Join-Path (Get-Item $PSScriptRoot).Parent.FullName Accounts.types.ps1xml) -ErrorAction Ignore +# SIG # Begin signature block +# MIInuQYJKoZIhvcNAQcCoIInqjCCJ6YCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjjCCGYoCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgpH7D8Not +# WnytrY9dBBVdkjoPJbp/Jb5/OaJtNH+9PHMwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBeESsu04jkAEIOu00+XAL5Cw3b4lPK1+Y/A63nt7uC +# g0IvVE66lSl52+b6CVBX/G72fi7HlOIYoCyVKEIasUVN+dqAtdM2ib0RLRPrWxH9 +# 2axBlgxQg9nBAZkklffNIZjmkC+gZN37i3g0DHSwmb1ej9OwHDD0MYQpF8oIa81e +# oj07j6dAzRwVM0TaHEJj9kPXA81HN6CAYBJ/V3p0wYRbp3c2L9j2R9MtVVvnx/7z +# sbKvHJV+l3b/xCT5T0/J5l5QoLzzNyfWB7Zvaz0DbKX1bln/rcb8uPYKVEz4wsKW +# 5zAm12WLQ87vxiIGLA6tv4lXxggEAUm68Nwjfw6vqkHRoYIXGDCCFxQGCisGAQQB +# gjcDAwExghcEMIIXAAYJKoZIhvcNAQcCoIIW8TCCFu0CAQMxDzANBglghkgBZQME +# AgEFADCCAVgGCyqGSIb3DQEJEAEEoIIBRwSCAUMwggE/AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIEbwTnYvqLH2wAcLSr8ZwikKunQnLTH8PEiqd0Vr +# sTtWAgZiMTFcHxoYEjIwMjIwMzMxMTAwMDA4Ljg4WjAEgAIB9KCB2KSB1TCB0jEL +# MAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v +# bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWlj +# cm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFs +# ZXMgVFNTIEVTTjpBMjQwLTRCODItMTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgU2VydmljZaCCEWgwggcUMIIE/KADAgECAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpX +# YXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQg +# Q29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAy +# MDEwMB4XDTIxMTAyODE5Mjc0NVoXDTIzMDEyNjE5Mjc0NVowgdIxCzAJBgNVBAYT +# AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD +# VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJ +# cmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBF +# U046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFNlcnZpY2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDaNEgtmD47 +# pTt0ty7AE8wH7S0lTPTAcuonl/soldCxPNZOgANQxhXjFVmen2Y9NaiNQn+Xc7he +# p6AsM124UA5tyK2svJjkcOzEB9QbX/ZiKVxKRI/oJwypZ+xLBQsZfnOWxUocnu2/ +# CDbrLp4uSVR0UymKrb3hPi4lB1d3k7uYXLS9WRoY8bE1YttnEo3Ooq0WdZDuMy1n +# Tle9p+QhZms1MW/wYakCUe1GxnUDwoOjogNIZU1lldtCz587Aw4an8HOh3x/Vgjw +# Zvag3+bHZxy90av2VrnlBl5Wwzst9NoQ9DFuABwuBYOUg9yZPNwGSwTMs5CxKkHO +# yo9pYj3KRXDmh+auQUoxulBPkQySLay4mhUznEaB1lae3+3PTTG5s9IoWLgHggwV +# QH2ZwA1Sr1wdouwdsMn4BSxU7SqdWPDNc9gl5HsL8HxfRSXpSQh2mVmadxBlIErf +# JlDL6gay4kpcUCrcGXFPqQO6Fhi87uK0us95jSSe63WsqTGib66Lq8J22EJ+cCLK +# SfJELaWSerPPzHWYORDlDo7H2nr+V24W6lIky2CwI8318i+t+mkwMUi9GhQuwc50 +# smOtGWLxyjkz69mZ/bShPFi5fMzS1tG6sQnJwHlkxvDOewUfKY6SDLHw54WddXdx +# qvjm56MjUHWKpQNt5I3Ge9zO46FynPBpyQIDAQABo4IBNjCCATIwHQYDVR0OBBYE +# FHjMkW6Hn0bClO5KO7hJNx+WKGaTMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMF8GA1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNv +# bS9wa2lvcHMvY3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEw +# KDEpLmNybDBsBggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFt +# cCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwDQYJKoZIhvcNAQELBQADggIBADWvc7PSUSrdW+l0WWHdgHFziGdi +# QAvJg8Nr0U7heCrCQGbwuxv6Ure1sYaCmLpAlsreIzcErQ5sFzBFolULEYsa2von +# P2FG6ZHIXyjifbLdiIq/iiUHE2MVKFIZz0Tb0mZWMGYuCZ+NGo9z/asPbmrijDi4 +# Detz16SJq5+AaFxIB16T+X6QBJvOiE63/nPb4iWBPh7dq5JTO3YYAp8pkHTZkMZY +# op4JjekQuPW26HrJ+s4k88ic7hlktbe+Apq+0vx7oUlnImgMUx7Ann2gQv4Ard7Y +# zYjggUT2fotVLxtL1RsxQy+sCVc3lkzYjwZ0cH1Nt8jXtab/1R/iq7nzw8k3u8Im +# P2z4rFmpdzmwZJwuCqI+ohts1MT78ARn95OLFz1guBPIypqRkjn3AaqOs41BJju7 +# RUQOQQTqKTP4VIVEorOnJJvRZOAy9bGwu9uc3wAKYhI+cEdhmgayw8Avt+gYYoUt +# 0AFNALY9fX1aOt/KuyEd2KpKUKymogYFPFFoe3I8yujcH/bqA98KXcwLesLc0arj +# EacgcNkZKLNSYaDxORACWhV1Tl0nW/3XSCPFrFpStoaE/wi20TRFadTldGn+wZo2 +# YNwzBvIe5KloWyfdDbU7OK0/gGc3m2msdqeAALuOh7jOYueZGcCJRz2xGpDZuaww +# C9Smw7yeU4WaIzUvMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTAN +# BgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y +# aXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC +# AgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDi +# vbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5G +# awcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUm +# ZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjks +# UZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvr +# g0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31B +# mkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PR +# c6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRR +# RuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSR +# lJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflS +# xIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHd +# MIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSa +# voKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYD +# VR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1Ud +# JQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjR +# PZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNy +# bDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9z +# b2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0G +# CSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHix +# BpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjY +# Ni6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe5 +# 3Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BU +# hUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QM +# vOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1A +# PMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsN +# n6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFs +# c/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue1 +# 0CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6g +# MTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm +# 8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0 +# aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpBMjQwLTRCODIt +# MTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEB +# MAcGBSsOAwIaAxUAgHOVkz1NE0Pg+C2ktZBmRI9hVwmggYMwgYCkfjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXvddYwIhgP +# MjAyMjAzMzEwODM1MzRaGA8yMDIyMDQwMTA4MzUzNFowdzA9BgorBgEEAYRZCgQB +# MS8wLTAKAgUA5e911gIBADAKAgEAAgIXqQIB/zAHAgEAAgIRHzAKAgUA5fDHVgIB +# ADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQow +# CAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBABjrSR17sdYAEtszvl2BWos/C7ZR +# fepANqhK1OqRLv3nelgcpzoYSpF3+csIJ5gGoL5clExMw1t3hkOSQLOzGWvkcWIY +# Tp5Pv4q/CpB/52Mrn1kC2zSej1E9lx0InBB++pTdEr3WCn9KDZsIy8B9M3gtEamp +# Di1hg/Yaskk2pVuQMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTACEzMAAAGNelUueHSZKrcAAQAAAY0wDQYJYIZIAWUDBAIBBQCgggFK +# MBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgv72G +# 0X2zWUJuJvjSqtgMZ02BVYmEgLTkIUsRp8UHvXIwgfoGCyqGSIb3DQEJEAIvMYHq +# MIHnMIHkMIG9BCCelhEz+h1eQMCfN/a50vnr1bxx8ZODBW56dDy20hjNfzCBmDCB +# gKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH +# EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNV +# BAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMCIEIKC8K55Td1F8Kw4pKkbmiSw7Hb/xIcUSNIsHKB52X2hTMA0GCSqG +# SIb3DQEBCwUABIICAMsOXK3vJQX7Jt2lDwVppNTdiboPDVwXRfezsK8NLGK7wZhp +# e/fEsGp3kFdqmeiDT/QGZV+ixnGjOTyJSaq6+wtvZyqKLUoEkhD9g+hFk23Hn3ui +# RiAp6LSf263zzgNQ9SbNssjiOChkILaTpt+GeV+lHAH6N412gYM7pbVyw9v7jvx+ +# Mp+iFKUVQAqZZDGm55MyTqfVdPeb8YpN9pqPSYG4ruCTwZBYGI+p7LFuKgQqF+FB +# 2KTqsTuxoHI6HAV3OibJcIFKQLFxaHjD0/YjYeZSoMUMD/ojZpdEoFrLtTXmIZ2e +# yOFKcX1LMzwwHhEpOpc9m9g4/B2kYTHUl1hFupXEu9PZnNa0IweqtM/GdX/Ji/// +# JRcDe8vtLNQz7z8ZQF28k1ufRDGfm5YIQDHu9Zx33gbpsWIyGZMmlbU4UMJDvAbM +# +sCYtGGLcMEObyiurnDOF4dix7QAdLWqGG2YiyZ9u0T/hRLi3THXhLGK5Xt4dgBk +# aeyJv7T3ZPfsbu8a10lgFkyVbmJt6up2OZbaqW1PjmvgtcsNmRyhD9oSZzOXdTiW +# iIGeLtHEkiSvZnWbaDqpx7ahcaHsmS5QvwWkYGGx1uHMOwJHuFq7jKPo3SYMxAwq +# GQW+QTZroDYL+UTfaUobfPyrS3bDw3L7xVqOOBwGidlOwx3ZYU4mNlSbfCN3 +# SIG # End signature block diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..4e557723dc33 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,234 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } + catch { + Write-Warning $_ + } +} +else { + try { + Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null + $assemblyLoadContextFolder = [System.IO.Path]::Combine($PSScriptRoot, "..", "AzSharedAlcAssemblies") + Write-Debug "Registering Az shared AssemblyLoadContext for path: '$assemblyLoadContextFolder'." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext($assemblyLoadContextFolder) + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIInrQYJKoZIhvcNAQcCoIInnjCCJ5oCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCfno9x0LEd5gPe +# 4cvAg6ULJtMLR6g+Xis+I4rbSZlHZqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZgjCCGX4CAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgyFkgUqEG +# ohT1KbDw544Hgmj3zWoOXkAlMHIwAyFcowAwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCa0t0uHrS1Z8rXJEETxc2oe78Dv4Qo198ub5+3zLvP +# Uwb+RkVmouToXjo3dapicrrP8ELcphopBonxGcVJFdu9HT8uuwL9KEp0yDpjUxKA +# 0yPVc1pc+f5vmlLY1kyUHMb9Deahzp5oJnL6NLyupJ8w6DLb21SCiIWl71l5vf2B +# i8Nx+jIjxGEC5Emqk6GLFAjR4TR6KO1j6gkHutOu3k0Q/+CgvgEwPbwtBXjcE9jV +# u7AZ6Iu5mE8q7NQ01GwWUMs13xpWLxE8HgvWtu3ozXjFeFaG3u9NEyx/zlkEB1cS +# Ntqh/F34ovkTvJxnIBPSRZfGubCV0fp9Qm0gXxrz3y/roYIXDDCCFwgGCisGAQQB +# gjcDAwExghb4MIIW9AYJKoZIhvcNAQcCoIIW5TCCFuECAQMxDzANBglghkgBZQME +# AgEFADCCAVUGCyqGSIb3DQEJEAEEoIIBRASCAUAwggE8AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIBvIyrpwHucEdb9YUkDCNmUPQk1ErTyZteMy3AB+ +# P++VAgZiL7Y+PNcYEzIwMjIwMzMxMTAwMDA5LjE3NlowBIACAfSggdSkgdEwgc4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1p +# Y3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZaCCEV8wggcQMIIE+KADAgECAhMzAAABpllFgzlNnutLAAEA +# AAGmMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo +# aW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y +# cG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEw +# MB4XDTIyMDMwMjE4NTEyMVoXDTIzMDUxMTE4NTEyMVowgc4xCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVy +# YXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJD +# LUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vydmlj +# ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANmYv3tSI+fJ/NQJnjz7 +# JvCnc+Xm0rKoe9YKD4MvMYCul7egdrT/zv5vFbQgjNQ74672fNweaztkR65V8y29 +# u5PL2sf01p+uche0Zu4tSig+GsQ6ZQl9tjPRAY/3ITBHDeIYyvq8Wne9+7NoPLhx +# DSO6dtX7YCuQ4zcTP3SE6MvB4b5NighdtvoZVaYk1lXpjUTfdmKoX1ABq1sJbULS +# nSi0Qd4vvl3mZ9jxwv9dR/nlZP62lrZYZq7LPtHD6BlmclB5PT89DnSm1sjaZnFH +# rKzOsmq5GlmL5SFugCCZOoKz133FJeQaFMcXBZSCQjNABWBbHIRCE1ysHHG83Ddo +# nRmnC8EOlYeRwTWz/QCz6q0riOIbYyC/A2BgUEpu9/9EymrTsyMr2/zS8GdEybQ5 +# W7f0WrcrmKB/Y62+g6TmfOS8NtU+L1jGoKNG6Q5RlfJwZu8J/Q9dl4OxyHKuy78+ +# wm6HsF7uAizpsWh63UUaoK/OGQiBG3NJ+kef5eWpnva4ZJfhAnqYTAZD1uHgf8Vf +# Qjnl0BB2YXzK9WaTqde8d+8qCxVKr5hJYvbO+X3+2k5PCirUK/SboreX+xUhVaQE +# hVDYqlatyPttI7Z2IrkhMzwFvc+p0QeyMiNmo2cBZejx8icDOcUidwymDUYqGPE7 +# MA8vtKW3feeSSYJsCEkuUO/vAgMBAAGjggE2MIIBMjAdBgNVHQ4EFgQUOlQhO/zG +# lqK99UkNL/Gu/AryN9gwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIw +# XwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9w +# cy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3Js +# MGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENB +# JTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcD +# CDANBgkqhkiG9w0BAQsFAAOCAgEAgMDxWDTpGqLnFoPhm/iDfwHGF8xr2NbrJl8e +# gEg2ThTJsTf0wBE+ZQsnYfrRmXBbe6sCXLVN70qPuI+OEbN5MOai7Bue1/4j5VTk +# WquH5GZeVat2N+dD7lSUWp0dU8j+uBhBL5GFSmoDVVm+zW2GR2juPI1v254AJTb2 +# l458anlkJjGvmYn2BtRS13h/wDR7hrQaI7BgdyHWAV5+HEj5UhrIrrvtwJiivSaU +# EA3qK6ZK/rZIQv/uORDkONw+2pHHIE1SXm/WIlhrVS2HIogfr3JjqvZion6LJSD7 +# 41j8xVDLiClwAbspHoVFjxtxBcMjqPx6aWCJS8vjSoTnhkV4PO55mqsM7Q8XQRGQ +# hA7w4zNQOJu9kD4xFdYpPUmLN/daIcEElofBjGz+sEd1B4yqqIk3u2G4VygTXFmt +# hL8chSo7r+GIvTqWKhSA/sanS4N3jCgCCe3FTSJsp4g5nwavLvWAtzcOIvSRorGm +# AeN0m2wgzBK95T/qgrGGDXSos1JNDWRVBnP0qsw1Qoq5G0D8hxvQPs3X43KBv1GJ +# l0wo5rcC+9OMWxJlB63gtToQsA1CErYoYLMZtUzJL74jwZk/grpHEQhIhB3sneC8 +# wzGKJuft7YO/HWCpuwdChIjynTnBh+yFGMdg3wRrIbOcw/iKmXZopMTQMOcmIeIw +# JAezA7AwggdxMIIFWaADAgECAhMzAAAAFcXna54Cm0mZAAAAAAAVMA0GCSqGSIb3 +# DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTIw +# MAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgMjAx +# MDAeFw0yMTA5MzAxODIyMjVaFw0zMDA5MzAxODMyMjVaMHwxCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFBDQSAyMDEwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA +# 5OGmTOe0ciELeaLL1yR5vQ7VgtP97pwHB9KpbE51yMo1V/YBf2xK4OK9uT4XYDP/ +# XE/HZveVU3Fa4n5KWv64NmeFRiMMtY0Tz3cywBAY6GB9alKDRLemjkZrBxTzxXb1 +# hlDcwUTIcVxRMTegCjhuje3XD9gmU3w5YQJ6xKr9cmmvHaus9ja+NSZk2pg7uhp7 +# M62AW36MEBydUv626GIl3GoPz130/o5Tz9bshVZN7928jaTjkY+yOSxRnOlwaQ3K +# Ni1wjjHINSi947SHJMPgyY9+tVSP3PoFVZhtaDuaRr3tpK56KTesy+uDRedGbsoy +# 1cCGMFxPLOJiss254o2I5JasAUq7vnGpF1tnYN74kpEeHT39IM9zfUGaRnXNxF80 +# 3RKJ1v2lIH1+/NmeRd+2ci/bfV+AutuqfjbsNkz2K26oElHovwUDo9Fzpk03dJQc +# NIIP8BDyt0cY7afomXw/TNuvXsLz1dhzPUNOwTM5TI4CvEJoLhDqhFFG4tG9ahha +# YQFzymeiXtcodgLiMxhy16cg8ML6EgrXY28MyTZki1ugpoMhXV8wdJGUlNi5UPkL +# iWHzNgY1GIRH29wb0f2y1BzFa/ZcUlFdEtsluq9QBXpsxREdcu+N+VLEhReTwDwV +# 2xo3xwgVGD94q0W29R6HXtqPnhZyacaue7e3PmriLq0CAwEAAaOCAd0wggHZMBIG +# CSsGAQQBgjcVAQQFAgMBAAEwIwYJKwYBBAGCNxUCBBYEFCqnUv5kxJq+gpE8RjUp +# zxD/LwTuMB0GA1UdDgQWBBSfpxVdAF5iXYP05dJlpxtTNRnpcjBcBgNVHSAEVTBT +# MFEGDCsGAQQBgjdMg30BATBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpb3BzL0RvY3MvUmVwb3NpdG9yeS5odG0wEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYDVR0PBAQDAgGG +# MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAU1fZWy4/oolxiaNE9lJBb186a +# GMQwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3Br +# aS9jcmwvcHJvZHVjdHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3JsMFoGCCsG +# AQUFBwEBBE4wTDBKBggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcnQwDQYJKoZIhvcN +# AQELBQADggIBAJ1VffwqreEsH2cBMSRb4Z5yS/ypb+pcFLY+TkdkeLEGk5c9MTO1 +# OdfCcTY/2mRsfNB1OW27DzHkwo/7bNGhlBgi7ulmZzpTTd2YurYeeNg2LpypglYA +# A7AFvonoaeC6Ce5732pvvinLbtg/SHUB2RjebYIM9W0jVOR4U3UkV7ndn/OOPcbz +# aN9l9qRWqveVtihVJ9AkvUCgvxm2EhIRXT0n4ECWOKz3+SmJw7wXsFSFQrP8DJ6L +# GYnn8AtqgcKBGUIZUnWKNsIdw2FzLixre24/LAl4FOmRsqlb30mjdAy87JGA0j3m +# Sj5mO0+7hvoyGtmW9I/2kQH2zsZ0/fZMcm8Qq3UwxTSwethQ/gpY3UA8x1RtnWN0 +# SCyxTkctwRQEcb9k+SS+c23Kjgm9swFXSVRk2XPXfx5bRAGOWhmRaw2fpCjcZxko +# JLo4S5pu+yFUa2pFEUep8beuyOiJXk+d0tBMdrVXVAmxaQFEfnyhYWxz/gq77EFm +# PWn9y8FBSX5+k77L+DvktxW/tM4+pTFRhLy/AsGConsXHRWJjXD+57XQKBqJC482 +# 2rpM+Zv/Cuk0+CQ1ZyvgDbjmjJnW4SLq8CdCPSWU5nR0W2rRnj7tfqAxM328y+l7 +# vzhwRNGQ8cirOoo6CGJ/2XBjU02N7oJtpQUQwXEGahC0HVUzWLOhcGbyoYIC0jCC +# AjsCAQEwgfyhgdSkgdEwgc4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNv +# MSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UE +# AxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUA +# anQzrZW9TB93Ve7Pa4UPao2ffK2ggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEG +# A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj +# cm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFt +# cCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXv9TcwIhgPMjAyMjAzMzExMzM5 +# MDNaGA8yMDIyMDQwMTEzMzkwM1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e/1 +# NwIBADAKAgEAAgIlMAIB/zAHAgEAAgIRCDAKAgUA5fFGtwIBADA2BgorBgEEAYRZ +# CgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0G +# CSqGSIb3DQEBBQUAA4GBALD1RzDUwq+H9m0MSYjCz5wQ1OtK2kysUfWmpMU4m/5I +# had8kbNZdJ3KIrx0YGBUzNZ+Lq0oh2bND8oZcOvd2Hp24j+V7qoE3si8uVWGudxS +# modF1/mMXXk9ekKyQlZEjz3BMuu37KSyigsrBtFsCP8HOYXKBGcDbc6qn5XH4yKD +# MYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMA +# AAGmWUWDOU2e60sAAQAAAaYwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJ +# AzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgBSF4kR8GItz8rwRGC1l8 +# k8ybbSy8clYGHzCOxkaX3MUwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCCD +# CxmLwz90fWvhMKbJTAQaKt3DoXeiAhfp8TD9tgSrDTCBmDCBgKR+MHwxCzAJBgNV +# BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4w +# HAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29m +# dCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABpllFgzlNnutLAAEAAAGmMCIEIBah +# XRJ2u8MV3DcxWnj3RsKu1063lhZi+mCg8CTJsOXVMA0GCSqGSIb3DQEBCwUABIIC +# AKwjzxsDe/9a9+S3w9P62SVFf6qdfGVu9TFSVozXaesncRAk2r5PYVIzQBLXEctH +# uMjKgizzU+OOxm1sxXQFxUa56d7W+W0Jg7ULtoKBKPQtEUN5uAo4j2bxZGMLqPMd +# DR5oFeKvtuIUk4DiXx02gUT6GITVUnFkkHt4y9j9PwZb7TNlan8/wTeTHO0kH2QZ +# xSt9oLx0jSb5/nBUCAE7G38h6P29oMvljU4xleVaSon0n73QlTg/hMAedxBVDol7 +# ZFh6Q93jDq/8l4XsA4y1UIObDo/8NxDvISc2tYeybT++wrtwkOLw6jpWXezk4uA3 +# cPi5rfOQhiBPG8dLCT9SWelaQWFq6wDL/wWQWWohrMVGaRoIp+p7TrRTUl3eoGIW +# lvUbTuUotQzzmQY1Zf8S4g430lulVYqdenhq6E3mzdU9VjueouAji4yYyJ8jeZmz +# c2e2W3goWOO5UWBujRETmFekpuj1cPiQ1en4QlRDeDHIgUa8OQcFbhof3cXZ0+CM +# mFYy5NofggR5oWN1IO6TAGc5w4tn+6i5RrR+C464W7R39A8peRCPXpZHMX5Nfinl +# McxNzvCRdwxdwMcfAl5fbvKiHAMFVaJlU8YkDHxtshVTBTAdB5scvBwEfVBqTRgN +# Y3evpxNmLhQ49mbUo+IsGdgKb4wU3AOkvXBDIVg0/Ll+ +# SIG # End signature block diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml new file mode 100644 index 000000000000..95d6227f2ef8 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/_rels/.rels b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/_rels/.rels new file mode 100644 index 000000000000..95479a0e6d24 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt new file mode 100644 index 000000000000..7e294d272854 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt @@ -0,0 +1,50 @@ +About topic for Azure PowerShell - about_az + +TOPIC + +about_Az + +SHORT DESCRIPTION + +The Azure Az PowerShell module is a set of cmdlets for managing Azure +resources directly from the PowerShell command line and in PowerShell +scripts. + +LONG DESCRIPTION + +Azure PowerShell provides cross-platform cmdlets for managing Azure +services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and +supported versions of PowerShell 7. + +The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}. + +- {verb} is an approved PowerShell verb reflecting the corresponding HTTP + operation. + +- {noun} matches or has a close equivalent to the name of the resource. + +The cmdlets produce .NET objects that can be piped between commands +simplifying the sequencing of commands making Azure PowerShell a powerful +solution for scripting and automation purposes. + +A PowerShell module is available for each Azure service. For convenience, +we provide a wrapper module named "Az" that comprises the stable modules. +Modules in preview must be installed independently or via the "AzPreview" +wrapper module. + +Azure PowerShell is frequently updated to include bug fixes and service +updates. It is recommended to plan to update to the most recent version +regularly (a minimum of twice a year). + +GETTING STARTED + +1. Connect to Azure using Connect-AzAccount + +2. Run your first command. For example, create a resource group in the + east US region. + + New-AzResourceGroup -Name "MyResoureGroup" -location "eastus" + +SEE ALSO + +Azure PowerShell documentation: https://docs.microsoft.com/powershell/azure diff --git a/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp new file mode 100644 index 000000000000..5c37526de859 --- /dev/null +++ b/swaggerci/datamigration/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp @@ -0,0 +1,11 @@ + + + Microsoft Corporation + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.7.5 + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + NuGet, Version=3.4.4.1321, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 6.2.9200.0;.NET Framework 4.5 + \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/datamigration/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..a2b5fda7a025 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/AsyncCommandRuntime.cs @@ -0,0 +1,832 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep func); + System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs); + + T ExecuteSync(System.Func step); + } + + public class AsyncCommandRuntime : System.Management.Automation.ICommandRuntime2, IAsyncCommandRuntimeExtensions, System.IDisposable + { + private ICommandRuntime2 originalCommandRuntime; + private System.Threading.Thread originalThread; + public bool AllowInteractive { get; set; } = false; + + public CancellationToken cancellationToken; + SemaphoreSlim semaphore = new SemaphoreSlim(1, 1); + ManualResetEventSlim readyToRun = new ManualResetEventSlim(false); + ManualResetEventSlim completed = new ManualResetEventSlim(false); + + System.Action runOnMainThread; + + private System.Management.Automation.PSCmdlet cmdlet; + + internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) + { + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + this.cancellationToken = cancellationToken; + this.cmdlet = cmdlet; + if (cmdlet.PagingParameters != null) + { + WriteDebug("Client side pagination is enabled for this cmdlet"); + } + cmdlet.CommandRuntime = this; + } + + public PSHost Host => this.originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => this.originalCommandRuntime.CurrentPSTransaction; + + private void CheckForInteractive() + { + // This is an interactive call -- if we are not on the original thread, this will only work if this was done at ACR creation time; + if (!AllowInteractive) + { + throw new System.Exception("AsyncCommandRuntime is not configured for interactive calls"); + } + } + private void WaitOurTurn() + { + // wait for our turn to play + semaphore?.Wait(cancellationToken); + + // ensure that completed is not set + completed.Reset(); + } + + private void WaitForCompletion() + { + // wait for the result (or cancellation!) + WaitHandle.WaitAny(new[] { cancellationToken.WaitHandle, completed?.WaitHandle }); + + // let go of the semaphore + semaphore?.Release(); + + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target, string action) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target, action); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target, action); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + ShouldProcessReason reason = ShouldProcessReason.None; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out reason); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + shouldProcessReason = reason; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.ThrowTerminatingError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.ThrowTerminatingError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool TransactionAvailable() + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.TransactionAvailable(); + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.TransactionAvailable(); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteCommandDetail(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteCommandDetail(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteCommandDetail(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteDebug(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteDebug(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteDebug(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteInformation(informationRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteInformation(informationRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(sourceId, progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(sourceId, progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteVerbose(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteVerbose(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteVerbose(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteWarning(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteWarning(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteWarning(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Wait(System.Threading.Tasks.Task ProcessRecordAsyncTask, System.Threading.CancellationToken cancellationToken) + { + do + { + WaitHandle.WaitAny(new[] { readyToRun.WaitHandle, ((System.IAsyncResult)ProcessRecordAsyncTask).AsyncWaitHandle }); + if (readyToRun.IsSet) + { + // reset the request for the next time + readyToRun.Reset(); + + // run the delegate on this thread + runOnMainThread(); + + // tell the originator everything is complete + completed.Set(); + } + } + while (!ProcessRecordAsyncTask.IsCompleted); + if (ProcessRecordAsyncTask.IsFaulted) + { + // don't unwrap a Aggregate Exception -- we'll lose the stack trace of the actual exception. + // if( ProcessRecordAsyncTask.Exception is System.AggregateException aggregate ) { + // throw aggregate.InnerException; + // } + throw ProcessRecordAsyncTask.Exception; + } + } + public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep func) => func.Target.GetType().Name != "Closure" ? func : (p1, p2, p3) => ExecuteSync>(() => func(p1, p2, p3)); + public System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs) => funcs?.Select(Wrap); + + public T ExecuteSync(System.Func step) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return step(); + } + + T result = default(T); + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + // set the function to run + runOnMainThread = () => { result = step(); }; + // tell the main thread to go ahead + readyToRun.Set(); + // wait for the result (or cancellation!) + WaitForCompletion(); + // return + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Dispose() + { + if (cmdlet != null) + { + cmdlet.CommandRuntime = this.originalCommandRuntime; + cmdlet = null; + } + + semaphore?.Dispose(); + semaphore = null; + readyToRun?.Dispose(); + readyToRun = null; + completed?.Dispose(); + completed = null; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/AsyncJob.cs b/swaggerci/datamigration/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..155618252baa --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/AsyncJob.cs @@ -0,0 +1,270 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + + using System.Threading.Tasks; + + public class LongRunningJobCancelledException : System.Exception + { + public LongRunningJobCancelledException(string message) : base(message) + { + + } + } + + public class AsyncJob : Job, System.Management.Automation.ICommandRuntime2 + { + const int MaxRecords = 1000; + + private string _statusMessage = string.Empty; + + public override string StatusMessage => _statusMessage; + + public override bool HasMoreData => Output.Count > 0 || Progress.Count > 0 || Error.Count > 0 || Warning.Count > 0 || Verbose.Count > 0 || Debug.Count > 0; + + public override string Location => "localhost"; + + public PSHost Host => originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => originalCommandRuntime.CurrentPSTransaction; + + public override void StopJob() + { + Cancel(); + } + + private readonly PSCmdlet cmdlet; + private readonly ICommandRuntime2 originalCommandRuntime; + private readonly System.Threading.Thread originalThread; + + private void CheckForInteractive() + { + // This is an interactive call -- We should never allow interactivity in AsnycJob cmdlets. + throw new System.Exception("Cmdlets in AsyncJob; interactive calls are not permitted."); + } + private bool IsJobDone => CancellationToken.IsCancellationRequested || this.JobStateInfo.State == JobState.Failed || this.JobStateInfo.State == JobState.Stopped || this.JobStateInfo.State == JobState.Stopping || this.JobStateInfo.State == JobState.Completed; + + private readonly System.Action Cancel; + private readonly CancellationToken CancellationToken; + + internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) + { + SetJobState(JobState.NotStarted); + // know how to cancel/check for cancelation + this.CancellationToken = cancellationToken; + this.Cancel = cancelMethod; + + // we might need these. + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + + // the instance of the cmdlet we're going to run + this.cmdlet = cmdlet; + + // set the command runtime to the AsyncJob + cmdlet.CommandRuntime = this; + } + + /// + /// Monitors the task (which should be ProcessRecordAsync) to control + /// the lifetime of the job itself + /// + /// + public void Monitor(Task task) + { + SetJobState(JobState.Running); + task.ContinueWith(antecedent => + { + if (antecedent.IsCanceled) + { + // if the task was canceled, we're just going to call it completed. + SetJobState(JobState.Completed); + } + else if (antecedent.IsFaulted) + { + foreach (var innerException in antecedent.Exception.Flatten().InnerExceptions) + { + WriteError(new System.Management.Automation.ErrorRecord(innerException, string.Empty, System.Management.Automation.ErrorCategory.NotSpecified, null)); + } + + // a fault indicates an actual failure + SetJobState(JobState.Failed); + } + else + { + // otherwiser it's a completed state. + SetJobState(JobState.Completed); + } + }, CancellationToken); + } + + private void CheckForCancellation() + { + if (IsJobDone) + { + throw new LongRunningJobCancelledException("Long running job is canceled or stopping, continuation of the cmdlet is not permitted."); + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + CheckForCancellation(); + + this.Information.Add(informationRecord); + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public void WriteDebug(string text) + { + _statusMessage = text; + CheckForCancellation(); + + if (Debug.IsOpen && Debug.Count < MaxRecords) + { + Debug.Add(new DebugRecord(text)); + } + } + + public void WriteError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + + public void WriteObject(object sendToPipeline) + { + CheckForCancellation(); + + if (Output.IsOpen) + { + Output.Add(new PSObject(sendToPipeline)); + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + CheckForCancellation(); + + if (enumerateCollection && sendToPipeline is System.Collections.IEnumerable enumerable) + { + foreach (var item in enumerable) + { + WriteObject(item); + } + } + else + { + WriteObject(sendToPipeline); + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteVerbose(string text) + { + CheckForCancellation(); + + if (Verbose.IsOpen && Verbose.Count < MaxRecords) + { + Verbose.Add(new VerboseRecord(text)); + } + } + + public void WriteWarning(string text) + { + CheckForCancellation(); + + if (Warning.IsOpen && Warning.Count < MaxRecords) + { + Warning.Add(new WarningRecord(text)); + } + } + + public void WriteCommandDetail(string text) + { + WriteVerbose(text); + } + + public bool ShouldProcess(string target) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string target, string action) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + CheckForInteractive(); + shouldProcessReason = ShouldProcessReason.None; + return false; + } + + public bool ShouldContinue(string query, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public bool TransactionAvailable() + { + // interactivity required? + return false; + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/AsyncOperationResponse.cs b/swaggerci/datamigration/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..040993a424e1 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/AsyncOperationResponse.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] + public class AsyncOperationResponse + { + private string _target; + public string Target { get => _target; set => _target = value; } + public AsyncOperationResponse() + { + } + internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json) + { + // pull target + { Target = If(json?.PropertyT("target"), out var _v) ? (string)_v : (string)Target; } + } + public string ToJsonString() + { + return $"{{ \"target\" : \"{this.Target}\" }}"; + } + + public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; + } + + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(jsonText)); + + } + + public partial class AsyncOperationResponseTypeConverter : System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static object ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; + } + catch + { + // Unable to use JSON pattern + } + + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..042ef4d11b9a --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs @@ -0,0 +1,113 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "CmdletSurface")] + [DoNotExport] + public class ExportCmdletSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CmdletFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool IncludeGeneralParameters { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetScriptCmdlets(this, CmdletFolder) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + foreach (var profileGroup in profileGroups) + { + var variantGroups = profileGroup.Variants + .GroupBy(v => new { v.CmdletName }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), String.Empty, profileGroup.ProfileName)); + var sb = UseExpandedFormat ? ExpandedFormat(variantGroups) : CondensedFormat(variantGroups); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, $"CmdletSurface-{profileGroup.ProfileName}.md"), sb.ToString()); + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private StringBuilder ExpandedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + foreach (var variantGroup in variantGroups.OrderBy(vg => vg.CmdletName)) + { + sb.Append($"### {variantGroup.CmdletName}{Environment.NewLine}"); + var parameterGroups = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private StringBuilder CondensedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + var condensedGroups = variantGroups + .GroupBy(vg => vg.CmdletNoun) + .Select(vgg => ( + CmdletNoun: vgg.Key, + CmdletVerbs: vgg.Select(vg => vg.CmdletVerb).OrderBy(cv => cv).ToArray(), + ParameterGroups: vgg.SelectMany(vg => vg.ParameterGroups).DistinctBy(p => p.ParameterName).ToArray(), + OutputTypes: vgg.SelectMany(vg => vg.OutputTypes).Select(ot => ot.Type).DistinctBy(t => t.Name).Select(t => t.ToSyntaxTypeName()).ToArray())) + .OrderBy(vg => vg.CmdletNoun); + foreach (var condensedGroup in condensedGroups) + { + sb.Append($"### {condensedGroup.CmdletNoun} [{String.Join(", ", condensedGroup.CmdletVerbs)}] `{String.Join(", ", condensedGroup.OutputTypes)}`{Environment.NewLine}"); + var parameterGroups = condensedGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..f84c89b25463 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ExampleStub")] + [DoNotExport] + public class ExportExampleStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + + var exampleText = String.Join(String.Empty, DefaultExampleHelpInfos.Select(ehi => ehi.ToHelpExampleOutput())); + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var cmdletFilePaths = GetScriptCmdlets(exportDirectory).Select(fi => Path.Combine(outputFolder, $"{fi.Name}.md")).ToArray(); + var currentExamplesFilePaths = Directory.GetFiles(outputFolder).ToArray(); + // Remove examples of non-existing cmdlets + var removedCmdletFilePaths = currentExamplesFilePaths.Except(cmdletFilePaths); + foreach (var removedCmdletFilePath in removedCmdletFilePaths) + { + File.Delete(removedCmdletFilePath); + } + + // Only create example stubs if they don't exist + foreach (var cmdletFilePath in cmdletFilePaths.Except(currentExamplesFilePaths)) + { + File.WriteAllText(cmdletFilePath, exampleText); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..b24846d57630 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "FormatPs1xml")] + [DoNotExport] + public class ExportFormatPs1xml : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FilePath { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support"; + private const string PropertiesExcludedForTableview = @""; + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + + protected override void ProcessRecord() + { + try + { + var viewModels = GetFilteredViewParameters().Select(CreateViewModel).ToList(); + var ps1xml = new Configuration + { + ViewDefinitions = new ViewDefinitions + { + Views = viewModels + } + }; + File.WriteAllText(FilePath, ps1xml.ToXmlString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static IEnumerable GetFilteredViewParameters() + { + //https://stackoverflow.com/a/79738/294804 + //https://stackoverflow.com/a/949285/294804 + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass + && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace)) + && !t.GetCustomAttributes().Any()); + return types.Select(t => new ViewParameters(t, t.GetProperties() + .Select(p => new PropertyFormat(p)) + .Where(pf => !pf.Property.GetCustomAttributes().Any() + && (!PropertiesExcludedForTableview.Split(',').Contains(pf.Property.Name)) + && (pf.FormatTable != null || (pf.Origin != PropertyOrigin.Inlined && pf.Property.PropertyType.IsPsSimple()))) + .OrderByDescending(pf => pf.Index.HasValue) + .ThenBy(pf => pf.Index) + .ThenByDescending(pf => pf.Origin.HasValue) + .ThenBy(pf => pf.Origin))).Where(vp => vp.Properties.Any()); + } + + private static View CreateViewModel(ViewParameters viewParameters) + { + var entries = viewParameters.Properties.Select(pf => + (TableColumnHeader: new TableColumnHeader { Label = pf.Label, Width = pf.Width }, + TableColumnItem: new TableColumnItem { PropertyName = pf.Property.Name })).ToArray(); + + return new View + { + Name = viewParameters.Type.FullName, + ViewSelectedBy = new ViewSelectedBy + { + TypeName = viewParameters.Type.FullName + }, + TableControl = new TableControl + { + TableHeaders = new TableHeaders + { + TableColumnHeaders = entries.Select(e => e.TableColumnHeader).ToList() + }, + TableRowEntries = new TableRowEntries + { + TableRowEntry = new TableRowEntry + { + TableColumnItems = new TableColumnItems + { + TableItems = entries.Select(e => e.TableColumnItem).ToList() + } + } + } + } + }; + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..b44829f012a5 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "HelpMarkdown")] + [DoNotExport] + public class ExportHelpMarkdown : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSModuleInfo ModuleInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] FunctionInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] HelpInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + var helpInfos = HelpInfo.Select(hi => hi.ToPsHelpInfo()); + var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() + .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) + .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..21b830d5db97 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ModelSurface")] + [DoNotExport] + public class ExportModelSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Support"; + + protected override void ProcessRecord() + { + try + { + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace))); + var typeInfos = types.Select(t => new ModelTypeInfo + { + Type = t, + TypeName = t.Name, + Properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.GetIndexParameters().Any()).OrderBy(p => p.Name).ToArray(), + NamespaceGroup = t.Namespace.Split('.').LastOrDefault().EmptyIfNull() + }).Where(mti => mti.Properties.Any()); + var sb = UseExpandedFormat ? ExpandedFormat(typeInfos) : CondensedFormat(typeInfos); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, "ModelSurface.md"), sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static StringBuilder ExpandedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + foreach (var typeInfo in typeInfos.OrderBy(mti => mti.TypeName).ThenBy(mti => mti.NamespaceGroup)) + { + sb.Append($"### {typeInfo.TypeName} [{typeInfo.NamespaceGroup}]{Environment.NewLine}"); + foreach (var property in typeInfo.Properties) + { + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private static StringBuilder CondensedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + var typeGroups = typeInfos + .GroupBy(mti => mti.TypeName) + .Select(tig => ( + Types: tig.Select(mti => mti.Type).ToArray(), + TypeName: tig.Key, + Properties: tig.SelectMany(mti => mti.Properties).DistinctBy(p => p.Name).OrderBy(p => p.Name).ToArray(), + NamespaceGroups: tig.Select(mti => mti.NamespaceGroup).OrderBy(ng => ng).ToArray() + )) + .OrderBy(tg => tg.TypeName); + foreach (var typeGroup in typeGroups) + { + var aType = typeGroup.Types.Select(GetAssociativeType).FirstOrDefault(t => t != null); + var aText = aType != null ? $@" \<{aType.ToSyntaxTypeName()}\>" : String.Empty; + sb.Append($"### {typeGroup.TypeName}{aText} [{String.Join(", ", typeGroup.NamespaceGroups)}]{Environment.NewLine}"); + foreach (var property in typeGroup.Properties) + { + var propertyAType = GetAssociativeType(property.PropertyType); + var propertyAText = propertyAType != null ? $" <{propertyAType.ToSyntaxTypeName()}>" : String.Empty; + var enumNames = GetEnumFieldNames(property.PropertyType.Unwrap()); + var enumNamesText = enumNames.Any() ? $" **{{{String.Join(", ", enumNames)}}}**" : String.Empty; + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}{propertyAText}`{enumNamesText}{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + //https://stackoverflow.com/a/4963190/294804 + private static Type GetAssociativeType(Type type) => + type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>))?.GetGenericArguments().First(); + + private static string[] GetEnumFieldNames(Type type) => + type.IsValueType && !type.IsPrimitive && type != typeof(decimal) && type != typeof(DateTime) + ? type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => f.FieldType == type).Select(p => p.Name).ToArray() + : new string[] { }; + + private class ModelTypeInfo + { + public Type Type { get; set; } + public string TypeName { get; set; } + public PropertyInfo[] Properties { get; set; } + public string NamespaceGroup { get; set; } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..2941e8186636 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ProxyCmdlet", DefaultParameterSetName = "Docs")] + [DoNotExport] + public class ExportProxyCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string[] ModulePath { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string InternalFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [AllowEmptyString] + public string ModuleDescription { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + public Guid ModuleGuid { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] + public SwitchParameter ExcludeDocs { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetModuleCmdletsAndHelpInfo(this, ModulePath).SelectMany(ci => ci.ToVariants()).Where(v => !v.IsDoNotExport).ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + var variantGroups = profileGroups.SelectMany(pg => pg.Variants + .GroupBy(v => new { v.CmdletName, v.IsInternal }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + .ToArray(); + + var license = new StringBuilder(); + license.Append(@" +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +"); + HashSet LicenseSet = new HashSet(); + foreach (var variantGroup in variantGroups) + { + var parameterGroups = variantGroup.ParameterGroups.ToList(); + var isValidProfile = !String.IsNullOrEmpty(variantGroup.ProfileName) && variantGroup.ProfileName != NoProfiles; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, variantGroup.ProfileName) : ExamplesFolder; + var markdownInfo = new MarkdownHelpInfo(variantGroup, examplesFolder); + List examples = new List(); + foreach (var it in markdownInfo.Examples) + { + examples.Add(it); + } + variantGroup.HelpInfo.Examples = examples.ToArray(); + var sb = new StringBuilder(); + sb.Append($"{Environment.NewLine}"); + sb.Append(variantGroup.ToHelpCommentOutput()); + sb.Append($"function {variantGroup.CmdletName} {{{Environment.NewLine}"); + sb.Append(variantGroup.Aliases.ToAliasOutput()); + sb.Append(variantGroup.OutputTypes.ToOutputTypeOutput()); + sb.Append(variantGroup.ToCmdletBindingOutput()); + sb.Append(variantGroup.ProfileName.ToProfileOutput()); + + sb.Append("param("); + sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) + { + var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; + parameters = parameters.Where(p => !p.IsHidden()); + if (!parameters.Any()) + { + continue; + } + foreach (var parameter in parameters) + { + sb.Append(parameter.ToParameterOutput(variantGroup.HasMultipleVariants, parameterGroup.HasAllVariants)); + } + sb.Append(parameterGroup.Aliases.ToAliasOutput(true)); + sb.Append(parameterGroup.HasValidateNotNull.ToValidateNotNullOutput()); + sb.Append(parameterGroup.HasAllowEmptyArray.ToAllowEmptyArray()); + sb.Append(parameterGroup.CompleterInfo.ToArgumentCompleterOutput()); + sb.Append(parameterGroup.OrderCategory.ToParameterCategoryOutput()); + sb.Append(parameterGroup.InfoAttribute.ToInfoOutput(parameterGroup.ParameterType)); + sb.Append(parameterGroup.ToDefaultInfoOutput()); + sb.Append(parameterGroup.ParameterType.ToParameterTypeOutput()); + sb.Append(parameterGroup.Description.ToParameterDescriptionOutput()); + sb.Append(parameterGroup.ParameterName.ToParameterNameOutput(parameterGroups.IndexOf(parameterGroup) == parameterGroups.Count - 1)); + } + sb.Append($"){Environment.NewLine}{Environment.NewLine}"); + + sb.Append(variantGroup.ToBeginOutput()); + sb.Append(variantGroup.ToProcessOutput()); + sb.Append(variantGroup.ToEndOutput()); + + sb.Append($"}}{Environment.NewLine}"); + + Directory.CreateDirectory(variantGroup.OutputFolder); + File.WriteAllText(variantGroup.FilePath, license.ToString()); + File.AppendAllText(variantGroup.FilePath, sb.ToString()); + if (!LicenseSet.Contains(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"))) + { + // only add license in the header + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), license.ToString()); + LicenseSet.Add(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1")); + } + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), sb.ToString()); + } + + if (!ExcludeDocs) + { + var moduleInfo = new PsModuleHelpInfo(ModuleName, ModuleGuid, ModuleDescription); + foreach (var variantGroupsByProfile in variantGroups.GroupBy(vg => vg.ProfileName)) + { + var profileName = variantGroupsByProfile.Key; + var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; + var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..3186a6e8a26f --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -0,0 +1,191 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "Psd1")] + [DoNotExport] + public class ExportPsd1 : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CustomFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + [Parameter(Mandatory = true)] + public Guid ModuleGuid { get; set; } + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private const string CustomFolderRelative = "./custom"; + private const string Indent = Psd1Indent; + private const string Undefined = "undefined"; + private bool IsUndefined(string value) => string.Equals(Undefined, value, StringComparison.OrdinalIgnoreCase); + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + if (!Directory.Exists(CustomFolder)) + { + throw new ArgumentException($"Custom folder '{CustomFolder}' does not exist"); + } + + string version = Convert.ToString(@"0.1.0"); + // Validate the module version should be semantic version + // Following regex is official from https://semver.org/ + Regex rx = new Regex(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", RegexOptions.Compiled); + if (rx.Matches(version).Count != 1) + { + throw new ArgumentException("Module-version is not a valid Semantic Version"); + } + + string previewVersion = null; + if (version.Contains('-')) + { + string[] versions = version.Split("-".ToCharArray(), 2); + version = versions[0]; + previewVersion = versions[1]; + } + + var sb = new StringBuilder(); + sb.AppendLine("@{"); + sb.AppendLine($@"{GuidStart} = '{ModuleGuid}'"); + sb.AppendLine($@"{Indent}RootModule = '{"./Az.DataMigration.psm1"}'"); + sb.AppendLine($@"{Indent}ModuleVersion = '{version}'"); + sb.AppendLine($@"{Indent}CompatiblePSEditions = 'Core', 'Desktop'"); + sb.AppendLine($@"{Indent}Author = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}CompanyName = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}Copyright = '{"Microsoft Corporation. All rights reserved."}'"); + sb.AppendLine($@"{Indent}Description = '{"Microsoft Azure PowerShell: DataMigration cmdlets"}'"); + sb.AppendLine($@"{Indent}PowerShellVersion = '5.1'"); + sb.AppendLine($@"{Indent}DotNetFrameworkVersion = '4.7.2'"); + + // RequiredModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredModules = @({"undefined"})"); + } + + // RequiredAssemblies + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredAssemblies = @({"undefined"})"); + } + else + { + sb.AppendLine($@"{Indent}RequiredAssemblies = '{"./bin/Az.DataMigration.private.dll"}'"); + } + + // NestedModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}NestedModules = @({"undefined"})"); + } + + // FormatsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FormatsToProcess = @({"undefined"})"); + } + else + { + var customFormatPs1xmlFiles = Directory.GetFiles(CustomFolder) + .Where(f => f.EndsWith(".format.ps1xml")) + .Select(f => $"{CustomFolderRelative}/{Path.GetFileName(f)}"); + var formatList = customFormatPs1xmlFiles.Prepend("./Az.DataMigration.format.ps1xml").ToPsList(); + sb.AppendLine($@"{Indent}FormatsToProcess = {formatList}"); + } + + // TypesToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}TypesToProcess = @({"undefined"})"); + } + + // ScriptsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}ScriptsToProcess = @({"undefined"})"); + } + + var functionInfos = GetScriptCmdlets(ExportsFolder).ToArray(); + // FunctionsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FunctionsToExport = @({"undefined"})"); + } + else + { + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); + } + + // AliasesToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}AliasesToExport = @({"undefined"})"); + } + else + { + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } + + // CmdletsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}CmdletsToExport = @({"undefined"})"); + } + + sb.AppendLine($@"{Indent}PrivateData = @{{"); + sb.AppendLine($@"{Indent}{Indent}PSData = @{{"); + + if (previewVersion != null) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = {previewVersion}"); + } + sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule DataMigration".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ProjectUri = '{"https://github.com/Azure/azure-powershell"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ReleaseNotes = ''"); + var profilesList = ""; + if (IsAzure && !String.IsNullOrEmpty(profilesList)) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Profiles = {profilesList}"); + } + + sb.AppendLine($@"{Indent}{Indent}}}"); + sb.AppendLine($@"{Indent}}}"); + sb.AppendLine(@"}"); + + File.WriteAllText(Psd1Path, sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..647ebef73e46 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -0,0 +1,148 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} +"); + File.WriteAllText(utilFile, sc.ToString()); + } + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath)" +); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} +"); + + + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..f61ef051f8c8 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "CommonParameter")] + [OutputType(typeof(Dictionary))] + [DoNotExport] + public class GetCommonParameter : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCmdlet PSCmdlet { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public Dictionary PSBoundParameter { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = PSCmdlet.MyInvocation.MyCommand.ToVariants(); + var commonParameterNames = variants.ToParameterGroups() + .Where(pg => pg.OrderCategory == ParameterCategory.Azure || pg.OrderCategory == ParameterCategory.Runtime) + .Select(pg => pg.ParameterName); + if (variants.Any(v => v.SupportsShouldProcess)) + { + commonParameterNames = commonParameterNames.Append("Confirm").Append("WhatIf"); + } + if (variants.Any(v => v.SupportsPaging)) + { + commonParameterNames = commonParameterNames.Append("First").Append("Skip").Append("IncludeTotalCount"); + } + + var names = commonParameterNames.ToArray(); + var keys = PSBoundParameter.Keys.Where(k => names.Contains(k)); + WriteObject(keys.ToDictionary(key => key, key => PSBoundParameter[key]), true); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..752b297ea248 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ModuleGuid")] + [DoNotExport] + public class GetModuleGuid : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + protected override void ProcessRecord() + { + try + { + WriteObject(ReadGuidFromPsd1(Psd1Path)); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..40e29dbb7a05 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ScriptCmdlet")] + [OutputType(typeof(string[]))] + [DoNotExport] + public class GetScriptCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ScriptFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeDoNotExport { get; set; } + + [Parameter] + public SwitchParameter AsAlias { get; set; } + + [Parameter] + public SwitchParameter AsFunctionInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var functionInfos = GetScriptCmdlets(this, ScriptFolder) + .Where(fi => IncludeDoNotExport || !fi.ScriptBlock.Attributes.OfType().Any()) + .ToArray(); + if (AsFunctionInfo) + { + WriteObject(functionInfos, true); + return; + } + var aliases = functionInfos.SelectMany(i => i.ScriptBlock.Attributes).ToAliasNames(); + var names = functionInfos.Select(fi => fi.Name).Distinct(); + var output = (AsAlias ? aliases : names).DefaultIfEmpty("''").ToArray(); + WriteObject(output, true); + } + catch (System.Exception ee) + { + System.Console.Error.WriteLine($"{ee.GetType().Name}: {ee.Message}"); + System.Console.Error.WriteLine(ee.StackTrace); + throw ee; + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/datamigration/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..d5f9daae4944 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/CollectionExtensions.cs @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal static class CollectionExtensions + { + public static T[] NullIfEmpty(this T[] collection) => (collection?.Any() ?? false) ? collection : null; + public static IEnumerable EmptyIfNull(this IEnumerable collection) => collection ?? Enumerable.Empty(); + + // https://stackoverflow.com/a/4158364/294804 + public static IEnumerable DistinctBy(this IEnumerable collection, Func selector) => + collection.GroupBy(selector).Select(group => group.First()); + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/datamigration/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..06432f020e1d --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal static class MarkdownRenderer + { + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + { + Directory.CreateDirectory(docsFolder); + var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); + + foreach (var markdownInfo in markdownInfos) + { + var sb = new StringBuilder(); + sb.Append(markdownInfo.ToHelpMetadataOutput()); + sb.Append($"# {markdownInfo.CmdletName}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"## SYNOPSIS{Environment.NewLine}{markdownInfo.Synopsis.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## SYNTAX{Environment.NewLine}{Environment.NewLine}"); + var hasMultipleParameterSets = markdownInfo.SyntaxInfos.Length > 1; + foreach (var syntaxInfo in markdownInfo.SyntaxInfos) + { + sb.Append(syntaxInfo.ToHelpSyntaxOutput(hasMultipleParameterSets)); + } + + sb.Append($"## DESCRIPTION{Environment.NewLine}{markdownInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## EXAMPLES{Environment.NewLine}{Environment.NewLine}"); + foreach (var exampleInfo in markdownInfo.Examples) + { + sb.Append(exampleInfo.ToHelpExampleOutput()); + } + + sb.Append($"## PARAMETERS{Environment.NewLine}{Environment.NewLine}"); + foreach (var parameter in markdownInfo.Parameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + if (markdownInfo.SupportsShouldProcess) + { + foreach (var parameter in SupportsShouldProcessParameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + } + + sb.Append($"### CommonParameters{Environment.NewLine}This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## INPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var input in markdownInfo.Inputs) + { + sb.Append($"### {input}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## OUTPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var output in markdownInfo.Outputs) + { + sb.Append($"### {output}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); + foreach (var relatedLink in markdownInfo.RelatedLinks) + { + sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); + } + + WriteModulePage(moduleHelpInfo, markdownInfos, docsFolder); + } + + private static void WriteModulePage(PsModuleHelpInfo moduleInfo, MarkdownHelpInfo[] markdownInfos, string docsFolder) + { + var sb = new StringBuilder(); + sb.Append(moduleInfo.ToModulePageMetadataOutput()); + sb.Append($"# {moduleInfo.Name} Module{Environment.NewLine}"); + sb.Append($"## Description{Environment.NewLine}{moduleInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## {moduleInfo.Name} Cmdlets{Environment.NewLine}"); + foreach (var markdownInfo in markdownInfos) + { + sb.Append(markdownInfo.ToModulePageCmdletOutput()); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{moduleInfo.Name}.md"), sb.ToString()); + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..a6aab1ad7128 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsFormatTypes.cs @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal class ViewParameters + { + public Type Type { get; } + public IEnumerable Properties { get; } + + public ViewParameters(Type type, IEnumerable properties) + { + Type = type; + Properties = properties; + } + } + + internal class PropertyFormat + { + public PropertyInfo Property { get; } + public FormatTableAttribute FormatTable { get; } + + public int? Index { get; } + public string Label { get; } + public int? Width { get; } + public PropertyOrigin? Origin { get; } + + public PropertyFormat(PropertyInfo propertyInfo) + { + Property = propertyInfo; + FormatTable = Property.GetCustomAttributes().FirstOrDefault(); + var origin = Property.GetCustomAttributes().FirstOrDefault(); + + Index = FormatTable?.HasIndex ?? false ? (int?)FormatTable.Index : null; + Label = FormatTable?.Label ?? propertyInfo.Name; + Width = FormatTable?.HasWidth ?? false ? (int?)FormatTable.Width : null; + // If we have an index, we don't want to use Origin. + Origin = FormatTable?.HasIndex ?? false ? null : origin?.Origin; + } + } + + [Serializable] + [XmlRoot(nameof(Configuration))] + public class Configuration + { + [XmlElement("ViewDefinitions")] + public ViewDefinitions ViewDefinitions { get; set; } + } + + [Serializable] + public class ViewDefinitions + { + //https://stackoverflow.com/a/10518657/294804 + [XmlElement("View")] + public List Views { get; set; } + } + + [Serializable] + public class View + { + [XmlElement(nameof(Name))] + public string Name { get; set; } + [XmlElement(nameof(ViewSelectedBy))] + public ViewSelectedBy ViewSelectedBy { get; set; } + [XmlElement(nameof(TableControl))] + public TableControl TableControl { get; set; } + } + + [Serializable] + public class ViewSelectedBy + { + [XmlElement(nameof(TypeName))] + public string TypeName { get; set; } + } + + [Serializable] + public class TableControl + { + [XmlElement(nameof(TableHeaders))] + public TableHeaders TableHeaders { get; set; } + [XmlElement(nameof(TableRowEntries))] + public TableRowEntries TableRowEntries { get; set; } + } + + [Serializable] + public class TableHeaders + { + [XmlElement("TableColumnHeader")] + public List TableColumnHeaders { get; set; } + } + + [Serializable] + public class TableColumnHeader + { + [XmlElement(nameof(Label))] + public string Label { get; set; } + [XmlElement(nameof(Width))] + public int? Width { get; set; } + + //https://stackoverflow.com/a/4095225/294804 + public bool ShouldSerializeWidth() => Width.HasValue; + } + + [Serializable] + public class TableRowEntries + { + [XmlElement(nameof(TableRowEntry))] + public TableRowEntry TableRowEntry { get; set; } + } + + [Serializable] + public class TableRowEntry + { + [XmlElement(nameof(TableColumnItems))] + public TableColumnItems TableColumnItems { get; set; } + } + + [Serializable] + public class TableColumnItems + { + [XmlElement("TableColumnItem")] + public List TableItems { get; set; } + } + + [Serializable] + public class TableColumnItem + { + [XmlElement(nameof(PropertyName))] + public string PropertyName { get; set; } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..0c5a776a668d --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal class HelpMetadataOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public HelpMetadataOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"--- +external help file:{(!String.IsNullOrEmpty(HelpInfo.ExternalHelpFilename) ? $" {HelpInfo.ExternalHelpFilename}" : String.Empty)} +Module Name: {HelpInfo.ModuleName} +online version: {HelpInfo.OnlineVersion} +schema: {HelpInfo.Schema.ToString(3)} +--- + +"; + } + + internal class HelpSyntaxOutput + { + public MarkdownSyntaxHelpInfo SyntaxInfo { get; } + public bool HasMultipleParameterSets { get; } + + public HelpSyntaxOutput(MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) + { + SyntaxInfo = syntaxInfo; + HasMultipleParameterSets = hasMultipleParameterSets; + } + + public override string ToString() + { + var psnText = HasMultipleParameterSets ? $"### {SyntaxInfo.ParameterSetName}{(SyntaxInfo.IsDefault ? " (Default)" : String.Empty)}{Environment.NewLine}" : String.Empty; + return $@"{psnText}``` +{SyntaxInfo.SyntaxText} +``` + +"; + } + } + + internal class HelpExampleOutput + { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + + public MarkdownExampleHelpInfo ExampleInfo { get; } + + public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) + { + ExampleInfo = exampleInfo; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } + } + + internal class HelpParameterOutput + { + public MarkdownParameterHelpInfo ParameterInfo { get; } + + public HelpParameterOutput(MarkdownParameterHelpInfo parameterInfo) + { + ParameterInfo = parameterInfo; + } + + public override string ToString() + { + var pipelineInputTypes = new[] + { + ParameterInfo.AcceptsPipelineByValue ? "ByValue" : String.Empty, + ParameterInfo.AcceptsPipelineByPropertyName ? "ByPropertyName" : String.Empty + }.JoinIgnoreEmpty(", "); + var pipelineInput = ParameterInfo.AcceptsPipelineByValue || ParameterInfo.AcceptsPipelineByPropertyName + ? $@"{true} ({pipelineInputTypes})" + : false.ToString(); + + return $@"### -{ParameterInfo.Name} +{ParameterInfo.Description.ToDescriptionFormat()} + +```yaml +Type: {ParameterInfo.Type.FullName} +Parameter Sets: {(ParameterInfo.HasAllParameterSets ? "(All)" : ParameterInfo.ParameterSetNames.JoinIgnoreEmpty(", "))} +Aliases:{(ParameterInfo.Aliases.Any() ? $" {ParameterInfo.Aliases.JoinIgnoreEmpty(", ")}" : String.Empty)} + +Required: {ParameterInfo.IsRequired} +Position: {ParameterInfo.Position} +Default value: {ParameterInfo.DefaultValue} +Accept pipeline input: {pipelineInput} +Accept wildcard characters: {ParameterInfo.AcceptsWildcardCharacters} +``` + +"; + } + } + + internal class ModulePageMetadataOutput + { + public PsModuleHelpInfo ModuleInfo { get; } + + private static string HelpLinkPrefix { get; } = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public ModulePageMetadataOutput(PsModuleHelpInfo moduleInfo) + { + ModuleInfo = moduleInfo; + } + + public override string ToString() => $@"--- +Module Name: {ModuleInfo.Name} +Module Guid: {ModuleInfo.Guid} +Download Help Link: {HelpLinkPrefix}{ModuleInfo.Name.ToLowerInvariant()} +Help Version: 1.0.0.0 +Locale: en-US +--- + +"; + } + + internal class ModulePageCmdletOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public ModulePageCmdletOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md) +{HelpInfo.Synopsis.ToDescriptionFormat()} + +"; + } + + internal static class PsHelpOutputExtensions + { + public static string EscapeAngleBrackets(this string text) => text?.Replace("<", @"\<").Replace(">", @"\>"); + public static string ReplaceSentenceEndWithNewline(this string text) => text?.Replace(". ", $".{Environment.NewLine}").Replace(". ", $".{Environment.NewLine}"); + public static string ReplaceBrWithNewline(this string text) => text?.Replace("
", $"{Environment.NewLine}"); + public static string ToDescriptionFormat(this string text, bool escapeAngleBrackets = true) + { + var description = text?.ReplaceBrWithNewline(); + description = escapeAngleBrackets ? description?.EscapeAngleBrackets() : description; + return description?.ReplaceSentenceEndWithNewline().Trim(); + } + + public const string ExampleNameHeader = "### "; + public const string ExampleCodeHeader = "```powershell"; + public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; + + public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); + + public static HelpSyntaxOutput ToHelpSyntaxOutput(this MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) => new HelpSyntaxOutput(syntaxInfo, hasMultipleParameterSets); + + public static HelpExampleOutput ToHelpExampleOutput(this MarkdownExampleHelpInfo exampleInfo) => new HelpExampleOutput(exampleInfo); + + public static HelpParameterOutput ToHelpParameterOutput(this MarkdownParameterHelpInfo parameterInfo) => new HelpParameterOutput(parameterInfo); + + public static ModulePageMetadataOutput ToModulePageMetadataOutput(this PsModuleHelpInfo moduleInfo) => new ModulePageMetadataOutput(moduleInfo); + + public static ModulePageCmdletOutput ToModulePageCmdletOutput(this MarkdownHelpInfo helpInfo) => new ModulePageCmdletOutput(helpInfo); + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..5c60a8e9f77b --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -0,0 +1,202 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal class PsHelpInfo + { + public string CmdletName { get; } + public string ModuleName { get; } + public string Synopsis { get; } + public string Description { get; } + public string AlertText { get; } + public string Category { get; } + public PsHelpLinkInfo OnlineVersion { get; } + public PsHelpLinkInfo[] RelatedLinks { get; } + public bool? HasCommonParameters { get; } + public bool? HasWorkflowCommonParameters { get; } + + public PsHelpTypeInfo[] InputTypes { get; } + public PsHelpTypeInfo[] OutputTypes { get; } + public PsHelpExampleInfo[] Examples { get; set; } + public string[] Aliases { get; } + + public PsParameterHelpInfo[] Parameters { get; } + public PsHelpSyntaxInfo[] Syntax { get; } + + public object Component { get; } + public object Functionality { get; } + public object PsSnapIn { get; } + public object Role { get; } + public string NonTerminatingErrors { get; } + + public PsHelpInfo(PSObject helpObject = null) + { + helpObject = helpObject ?? new PSObject(); + CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); + ModuleName = helpObject.GetProperty("ModuleName"); + Synopsis = helpObject.GetProperty("Synopsis"); + Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? + helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); + Category = helpObject.GetProperty("Category"); + HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); + HasWorkflowCommonParameters = helpObject.GetProperty("WorkflowCommonParameters").ToNullableBool(); + + var links = helpObject.GetNestedProperty("relatedLinks", "navigationLink").EmptyIfNull().Select(nl => nl.ToLinkInfo()).ToArray(); + OnlineVersion = links.FirstOrDefault(l => l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length == 1); + RelatedLinks = links.Where(l => !l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length != 1).ToArray(); + + InputTypes = helpObject.GetNestedProperty("inputTypes", "inputType").EmptyIfNull().Select(it => it.ToTypeInfo()).ToArray(); + OutputTypes = helpObject.GetNestedProperty("returnValues", "returnValue").EmptyIfNull().Select(rv => rv.ToTypeInfo()).ToArray(); + Examples = helpObject.GetNestedProperty("examples", "example").EmptyIfNull().Select(e => e.ToExampleInfo()).ToArray(); + Aliases = helpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + + Parameters = helpObject.GetNestedProperty("parameters", "parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + Syntax = helpObject.GetNestedProperty("syntax", "syntaxItem").EmptyIfNull().Select(si => si.ToSyntaxInfo()).ToArray(); + + Component = helpObject.GetProperty("Component"); + Functionality = helpObject.GetProperty("Functionality"); + PsSnapIn = helpObject.GetProperty("PSSnapIn"); + Role = helpObject.GetProperty("Role"); + NonTerminatingErrors = helpObject.GetProperty("nonTerminatingErrors"); + } + } + + internal class PsHelpTypeInfo + { + public string Name { get; } + public string Description { get; } + + public PsHelpTypeInfo(PSObject typeObject) + { + Name = typeObject.GetNestedProperty("type", "name").EmptyIfNull().Trim(); + Description = typeObject.GetProperty("description").EmptyIfNull().ToDescriptionText(); + } + } + + internal class PsHelpLinkInfo + { + public string Uri { get; } + public string Text { get; } + + public PsHelpLinkInfo(PSObject linkObject) + { + Uri = linkObject.GetProperty("uri"); + Text = linkObject.GetProperty("linkText"); + } + } + + internal class PsHelpSyntaxInfo + { + public string CmdletName { get; } + public PsParameterHelpInfo[] Parameters { get; } + + public PsHelpSyntaxInfo(PSObject syntaxObject) + { + CmdletName = syntaxObject.GetProperty("name"); + Parameters = syntaxObject.GetProperty("parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + } + } + + internal class PsHelpExampleInfo + { + public string Title { get; } + public string Code { get; } + public string Output { get; } + public string Remarks { get; } + + public PsHelpExampleInfo(PSObject exampleObject) + { + Title = exampleObject.GetProperty("title"); + Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); + Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); + } + public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) + { + Title = markdownExample.Name; + Code = markdownExample.Code; + Output = markdownExample.Output; + Remarks = markdownExample.Description; + } + + public static implicit operator PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) => new PsHelpExampleInfo(markdownExample); + } + + internal class PsParameterHelpInfo + { + public string DefaultValueAsString { get; } + + public string Name { get; } + public string TypeName { get; } + public string Description { get; } + public string SupportsPipelineInput { get; } + public string PositionText { get; } + public string[] ParameterSetNames { get; } + public string[] Aliases { get; } + + public bool? SupportsGlobbing { get; } + public bool? IsRequired { get; } + public bool? IsVariableLength { get; } + public bool? IsDynamic { get; } + + public PsParameterHelpInfo(PSObject parameterHelpObject = null) + { + parameterHelpObject = parameterHelpObject ?? new PSObject(); + DefaultValueAsString = parameterHelpObject.GetProperty("defaultValue"); + Name = parameterHelpObject.GetProperty("name"); + TypeName = parameterHelpObject.GetProperty("parameterValue").NullIfEmpty() ?? parameterHelpObject.GetNestedProperty("type", "name"); + Description = parameterHelpObject.GetProperty("Description").EmptyIfNull().ToDescriptionText(); + SupportsPipelineInput = parameterHelpObject.GetProperty("pipelineInput"); + PositionText = parameterHelpObject.GetProperty("position"); + ParameterSetNames = parameterHelpObject.GetProperty("parameterSetName").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + Aliases = parameterHelpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + + SupportsGlobbing = parameterHelpObject.GetProperty("globbing").ToNullableBool(); + IsRequired = parameterHelpObject.GetProperty("required").ToNullableBool(); + IsVariableLength = parameterHelpObject.GetProperty("variableLength").ToNullableBool(); + IsDynamic = parameterHelpObject.GetProperty("isDynamic").ToNullableBool(); + } + } + + internal class PsModuleHelpInfo + { + public string Name { get; } + public Guid Guid { get; } + public string Description { get; } + + public PsModuleHelpInfo(PSModuleInfo moduleInfo) + : this(moduleInfo?.Name ?? String.Empty, moduleInfo?.Guid ?? Guid.NewGuid(), moduleInfo?.Description ?? String.Empty) + { + } + + public PsModuleHelpInfo(string name, Guid guid, string description) + { + Name = name; + Guid = guid; + Description = description; + } + } + + internal static class HelpTypesExtensions + { + public static PsHelpInfo ToPsHelpInfo(this PSObject helpObject) => new PsHelpInfo(helpObject); + public static PsParameterHelpInfo ToPsParameterHelpInfo(this PSObject parameterHelpObject) => new PsParameterHelpInfo(parameterHelpObject); + + public static string ToDescriptionText(this IEnumerable descriptionObject) => descriptionObject != null + ? String.Join(Environment.NewLine, descriptionObject.Select(dl => dl.GetProperty("Text").EmptyIfNull())).NullIfWhiteSpace() + : null; + public static PsHelpTypeInfo ToTypeInfo(this PSObject typeObject) => new PsHelpTypeInfo(typeObject); + public static PsHelpExampleInfo ToExampleInfo(this PSObject exampleObject) => new PsHelpExampleInfo(exampleObject); + public static PsHelpLinkInfo ToLinkInfo(this PSObject linkObject) => new PsHelpLinkInfo(linkObject); + public static PsHelpSyntaxInfo ToSyntaxInfo(this PSObject syntaxObject) => new PsHelpSyntaxInfo(syntaxObject); + public static PsModuleHelpInfo ToModuleInfo(this PSModuleInfo moduleInfo) => new PsModuleHelpInfo(moduleInfo); + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..d4772f4010a2 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -0,0 +1,294 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal class MarkdownHelpInfo + { + public string ExternalHelpFilename { get; } + public string ModuleName { get; } + public string OnlineVersion { get; } + public Version Schema { get; } + + public string CmdletName { get; } + public string[] Aliases { get; } + public string Synopsis { get; } + public string Description { get; } + + public MarkdownSyntaxHelpInfo[] SyntaxInfos { get; } + public MarkdownExampleHelpInfo[] Examples { get; } + public MarkdownParameterHelpInfo[] Parameters { get; } + + public string[] Inputs { get; } + public string[] Outputs { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + public string[] RelatedLinks { get; } + + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") + { + ExternalHelpFilename = externalHelpFilename; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; + var helpInfo = variantGroup.HelpInfo; + var commentInfo = variantGroup.CommentInfo; + Schema = Version.Parse("2.0.0"); + + CmdletName = variantGroup.CmdletName; + Aliases = (variantGroup.Aliases.NullIfEmpty() ?? helpInfo.Aliases).Where(a => a != "None").ToArray(); + Synopsis = commentInfo.Synopsis; + Description = commentInfo.Description; + + SyntaxInfos = variantGroup.Variants + .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName)) + .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray(); + Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty() + ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty() + ?? DefaultExampleHelpInfos; + + Parameters = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden())) + .Select(pg => new MarkdownParameterHelpInfo( + variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg)) + .OrderBy(phi => phi.Name).ToArray(); + + Inputs = commentInfo.Inputs; + Outputs = commentInfo.Outputs; + + ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; + OnlineVersion = commentInfo.OnlineVersion; + RelatedLinks = commentInfo.RelatedLinks; + + SupportsShouldProcess = variantGroup.SupportsShouldProcess; + SupportsPaging = variantGroup.SupportsPaging; + } + + private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) + { + var filePath = Path.Combine(examplesFolder, $"{CmdletName}.md"); + if (!Directory.Exists(examplesFolder) || !File.Exists(filePath)) return null; + + var lines = File.ReadAllLines(filePath); + var nameIndices = lines.Select((l, i) => l.StartsWith(ExampleNameHeader) ? i : -1).Where(i => i != -1).ToArray(); + //https://codereview.stackexchange.com/a/187148/68772 + var indexCountGroups = nameIndices.Skip(1).Append(lines.Length).Zip(nameIndices, (next, current) => (NameIndex: current, LineCount: next - current)); + var exampleGroups = indexCountGroups.Select(icg => lines.Skip(icg.NameIndex).Take(icg.LineCount).ToArray()); + return exampleGroups.Select(eg => + { + var name = eg.First().Replace(ExampleNameHeader, String.Empty); + var codeStartIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var codeEndIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i != codeStartIndex); + var code = codeStartIndex.HasValue && codeEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) + : String.Empty; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; + descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; + var descriptionEndIndex = eg.Length - 1; + descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; + var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); + return new MarkdownExampleHelpInfo(name, code, output, description); + }).ToArray(); + } + } + + internal class MarkdownSyntaxHelpInfo + { + public Variant Variant { get; } + public bool IsDefault { get; } + public string ParameterSetName { get; } + public Parameter[] Parameters { get; } + public string SyntaxText { get; } + + public MarkdownSyntaxHelpInfo(Variant variant, ParameterGroup[] parameterGroups, bool isDefault) + { + Variant = variant; + IsDefault = isDefault; + ParameterSetName = Variant.VariantName; + Parameters = Variant.Parameters + .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory) + //https://stackoverflow.com/a/6461526/294804 + .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position) + // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants. + .ThenBy(p => parameterGroups.First(pg => pg.ParameterName == p.ParameterName).OrderCategory).ThenBy(p => p.ParameterName).ToArray(); + SyntaxText = CreateSyntaxFormat(); + } + + //https://github.com/PowerShell/platyPS/blob/a607a926bfffe1e1a1e53c19e0057eddd0c07611/src/Markdown.MAML/Renderer/Markdownv2Renderer.cs#L29-L32 + private const int SyntaxLineWidth = 110; + private string CreateSyntaxFormat() + { + var parameterStrings = Parameters.Select(p => p.ToPropertySyntaxOutput().ToString()); + if (Variant.SupportsShouldProcess) + { + parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]"); + } + parameterStrings = parameterStrings.Append(" []"); + + var lines = new List(20); + return parameterStrings.Aggregate(Variant.CmdletName, (current, ps) => + { + var combined = current + ps; + if (combined.Length <= SyntaxLineWidth) return combined; + + lines.Add(current); + return ps; + }, last => + { + lines.Add(last); + return String.Join(Environment.NewLine, lines); + }); + } + } + + internal class MarkdownExampleHelpInfo + { + public string Name { get; } + public string Code { get; } + public string Output { get; } + public string Description { get; } + + public MarkdownExampleHelpInfo(string name, string code, string output, string description) + { + Name = name; + Code = code; + Output = output; + Description = description; + } + } + + internal class MarkdownParameterHelpInfo + { + public string Name { get; set; } + public string Description { get; set; } + public Type Type { get; set; } + public string Position { get; set; } + public string DefaultValue { get; set; } + + public bool HasAllParameterSets { get; set; } + public string[] ParameterSetNames { get; set; } + public string[] Aliases { get; set; } + + public bool IsRequired { get; set; } + public bool IsDynamic { get; set; } + public bool AcceptsPipelineByValue { get; set; } + public bool AcceptsPipelineByPropertyName { get; set; } + public bool AcceptsWildcardCharacters { get; set; } + + // For use by common parameters that have no backing data in the objects themselves. + public MarkdownParameterHelpInfo() { } + + public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, ParameterGroup parameterGroup) + { + Name = parameterGroup.ParameterName; + Description = parameterGroup.Description.NullIfEmpty() + ?? parameterHelpInfos.Select(phi => phi.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + Type = parameterGroup.ParameterType; + Position = parameterGroup.FirstPosition?.ToString() + ?? parameterHelpInfos.Select(phi => phi.PositionText).FirstOrDefault(d => !String.IsNullOrEmpty(d)).ToUpperFirstCharacter().NullIfEmpty() + ?? "Named"; + // This no longer uses firstHelpInfo.DefaultValueAsString since it seems to be broken. For example, it has a value of 0 for Int32, but no default value was declared. + DefaultValue = parameterGroup.DefaultInfo?.Script ?? "None"; + + HasAllParameterSets = parameterGroup.HasAllVariants; + ParameterSetNames = (parameterGroup.Parameters.Select(p => p.VariantName).ToArray().NullIfEmpty() + ?? parameterHelpInfos.SelectMany(phi => phi.ParameterSetNames).Distinct()) + .OrderBy(psn => psn).ToArray(); + Aliases = parameterGroup.Aliases.NullIfEmpty() ?? parameterHelpInfos.SelectMany(phi => phi.Aliases).ToArray(); + + IsRequired = parameterHelpInfos.Select(phi => phi.IsRequired).FirstOrDefault(r => r == true) ?? parameterGroup.Parameters.Any(p => p.IsMandatory); + IsDynamic = parameterHelpInfos.Select(phi => phi.IsDynamic).FirstOrDefault(d => d == true) ?? false; + AcceptsPipelineByValue = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByValue")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipeline; + AcceptsPipelineByPropertyName = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByPropertyName")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipelineByPropertyName; + AcceptsWildcardCharacters = parameterGroup.SupportsWildcards; + } + } + + internal static class MarkdownTypesExtensions + { + public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); + + public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = + { + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + }; + + public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = + { + new MarkdownParameterHelpInfo + { + Name = "Confirm", + Description ="Prompts you for confirmation before running the cmdlet.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "cf" } + }, + new MarkdownParameterHelpInfo + { + Name = "WhatIf", + Description ="Shows what would happen if the cmdlet runs. The cmdlet is not run.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "wi" } + } + }; + + public static MarkdownParameterHelpInfo[] SupportsPagingParameters = + { + new MarkdownParameterHelpInfo + { + Name = "First", + Description ="Gets only the first 'n' objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "IncludeTotalCount", + Description ="Reports the number of objects in the data set (an integer) followed by the objects. If the cmdlet cannot determine the total count, it returns \"Unknown total count\".", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "Skip", + Description ="Ignores the first 'n' objects and then gets the remaining objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + } + }; + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..57fcd2428501 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,611 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal class OutputTypeOutput + { + public PSTypeName[] OutputTypes { get; } + + public OutputTypeOutput(IEnumerable outputTypes) + { + OutputTypes = outputTypes.ToArray(); + } + + public override string ToString() => OutputTypes != null && OutputTypes.Any() ? $"[OutputType({OutputTypes.Select(ot => $"[{ot}]").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class CmdletBindingOutput + { + public VariantGroup VariantGroup { get; } + + public CmdletBindingOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + + public override string ToString() + { + var dpsText = VariantGroup.DefaultParameterSetName.IsValidDefaultParameterSetName() ? $"DefaultParameterSetName='{VariantGroup.DefaultParameterSetName}'" : String.Empty; + var sspText = VariantGroup.SupportsShouldProcess ? $"SupportsShouldProcess{ItemSeparator}ConfirmImpact='Medium'" : String.Empty; + var pbText = $"PositionalBinding={false.ToPsBool()}"; + var propertyText = new[] { dpsText, pbText, sspText }.JoinIgnoreEmpty(ItemSeparator); + return $"[CmdletBinding({propertyText})]{Environment.NewLine}"; + } + } + + internal class ParameterOutput + { + public Parameter Parameter { get; } + public bool HasMultipleVariantsInVariantGroup { get; } + public bool HasAllVariantsInParameterGroup { get; } + + public ParameterOutput(Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) + { + Parameter = parameter; + HasMultipleVariantsInVariantGroup = hasMultipleVariantsInVariantGroup; + HasAllVariantsInParameterGroup = hasAllVariantsInParameterGroup; + } + + public override string ToString() + { + var psnText = HasMultipleVariantsInVariantGroup && !HasAllVariantsInParameterGroup ? $"ParameterSetName='{Parameter.VariantName}'" : String.Empty; + var positionText = Parameter.Position != null ? $"Position={Parameter.Position}" : String.Empty; + var mandatoryText = Parameter.IsMandatory ? "Mandatory" : String.Empty; + var dontShowText = Parameter.DontShow ? "DontShow" : String.Empty; + var vfpText = Parameter.ValueFromPipeline ? "ValueFromPipeline" : String.Empty; + var vfpbpnText = Parameter.ValueFromPipelineByPropertyName ? "ValueFromPipelineByPropertyName" : String.Empty; + var propertyText = new[] { psnText, positionText, mandatoryText, dontShowText, vfpText, vfpbpnText }.JoinIgnoreEmpty(ItemSeparator); + return $"{Indent}[Parameter({propertyText})]{Environment.NewLine}"; + } + } + + internal class AliasOutput + { + public string[] Aliases { get; } + public bool IncludeIndent { get; } + + public AliasOutput(string[] aliases, bool includeIndent = false) + { + Aliases = aliases; + IncludeIndent = includeIndent; + } + + public override string ToString() => Aliases?.Any() ?? false ? $"{(IncludeIndent ? Indent : String.Empty)}[Alias({Aliases.Select(an => $"'{an}'").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class ValidateNotNullOutput + { + public bool HasValidateNotNull { get; } + + public ValidateNotNullOutput(bool hasValidateNotNull) + { + HasValidateNotNull = hasValidateNotNull; + } + + public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty; + } + + internal class AllowEmptyArrayOutput + { + public bool HasAllowEmptyArray { get; } + + public AllowEmptyArrayOutput(bool hasAllowEmptyArray) + { + HasAllowEmptyArray = hasAllowEmptyArray; + } + + public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty; + } + internal class ArgumentCompleterOutput + { + public CompleterInfo CompleterInfo { get; } + + public ArgumentCompleterOutput(CompleterInfo completerInfo) + { + CompleterInfo = completerInfo; + } + + public override string ToString() => CompleterInfo != null + ? $"{Indent}[ArgumentCompleter({(CompleterInfo.IsTypeCompleter ? $"[{CompleterInfo.Type.Unwrap().ToPsType()}]" : $"{{{CompleterInfo.Script.ToPsSingleLine("; ")}}}")})]{Environment.NewLine}" + : String.Empty; + } + + internal class DefaultInfoOutput + { + public bool HasDefaultInfo { get; } + public DefaultInfo DefaultInfo { get; } + + public DefaultInfoOutput(ParameterGroup parameterGroup) + { + HasDefaultInfo = parameterGroup.HasDefaultInfo; + DefaultInfo = parameterGroup.DefaultInfo; + } + + public override string ToString() + { + var nameText = !String.IsNullOrEmpty(DefaultInfo?.Name) ? $"Name='{DefaultInfo?.Name}'" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(DefaultInfo?.Description) ? $"Description='{DefaultInfo?.Description.ToPsStringLiteral()}'" : String.Empty; + var scriptText = !String.IsNullOrEmpty(DefaultInfo?.Script) ? $"Script='{DefaultInfo?.Script.ToPsSingleLine("; ")}'" : String.Empty; + var propertyText = new[] { nameText, descriptionText, scriptText }.JoinIgnoreEmpty(ItemSeparator); + return HasDefaultInfo ? $"{Indent}[{typeof(DefaultInfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class ParameterTypeOutput + { + public Type ParameterType { get; } + + public ParameterTypeOutput(Type parameterType) + { + ParameterType = parameterType; + } + + public override string ToString() => $"{Indent}[{ParameterType.ToPsType()}]{Environment.NewLine}"; + } + + internal class ParameterNameOutput + { + public string ParameterName { get; } + public bool IsLast { get; } + + public ParameterNameOutput(string parameterName, bool isLast) + { + ParameterName = parameterName; + IsLast = isLast; + } + + public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; + } + + internal class BaseOutput + { + public VariantGroup VariantGroup { get; } + + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + public string GetProcessCustomAttributesAtRuntime() + { + return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + } + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"begin {{ +{Indent}try {{ +{Indent}{Indent}$outBuffer = $null +{Indent}{Indent}if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {{ +{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 +{Indent}{Indent}}} +{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} +{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} +{GetProcessCustomAttributesAtRuntime()} +{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} +{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) +{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} + +"; + + private string GetParameterSetToCmdletMapping() + { + var sb = new StringBuilder(); + sb.AppendLine($"{Indent}{Indent}$mapping = @{{"); + foreach (var variant in VariantGroup.Variants) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}{variant.VariantName} = '{variant.PrivateModuleName}\{variant.PrivateCmdletName}';"); + } + sb.Append($"{Indent}{Indent}}}"); + return sb.ToString(); + } + + private string GetDefaultValuesStatements() + { + var defaultInfos = VariantGroup.ParameterGroups.Where(pg => pg.HasDefaultInfo).Select(pg => pg.DefaultInfo).ToArray(); + var sb = new StringBuilder(); + + foreach (var defaultInfo in defaultInfos) + { + var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); + var parameterName = defaultInfo.ParameterGroup.ParameterName; + sb.AppendLine(); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + return sb.ToString(); + } + } + + internal class ProcessOutput : BaseOutput + { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"process {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.Process($_) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +{GetFinally()} +}} +"; + } + + internal class EndOutput : BaseOutput + { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.DataMigration.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } + public override string ToString() => $@"end {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} +"; + } + + internal class HelpCommentOutput + { + public VariantGroup VariantGroup { get; } + public CommentInfo CommentInfo { get; } + + public HelpCommentOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + CommentInfo = variantGroup.CommentInfo; + } + + public override string ToString() + { + var inputs = String.Join(Environment.NewLine, CommentInfo.Inputs.Select(i => $".Inputs{Environment.NewLine}{i}")); + var inputsText = !String.IsNullOrEmpty(inputs) ? $"{Environment.NewLine}{inputs}" : String.Empty; + var outputs = String.Join(Environment.NewLine, CommentInfo.Outputs.Select(o => $".Outputs{Environment.NewLine}{o}")); + var outputsText = !String.IsNullOrEmpty(outputs) ? $"{Environment.NewLine}{outputs}" : String.Empty; + var notes = String.Join($"{Environment.NewLine}{Environment.NewLine}", VariantGroup.ComplexInterfaceInfos.Select(cii => cii.ToNoteOutput())); + var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; + var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); + var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var examples = ""; + foreach (var example in VariantGroup.HelpInfo.Examples) + { + examples = examples + ".Example" + "\r\n" + example.Code + "\r\n"; + } + return $@"<# +.Synopsis +{CommentInfo.Synopsis.ToDescriptionFormat(false)} +.Description +{CommentInfo.Description.ToDescriptionFormat(false)} +{examples}{inputsText}{outputsText}{notesText} +.Link +{CommentInfo.OnlineVersion}{relatedLinksText} +#> +"; + } + } + + internal class ParameterDescriptionOutput + { + public string Description { get; } + + public ParameterDescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) + ? Description.ToDescriptionFormat(false).NormalizeNewLines() + .Split(new[] { Environment.NewLine }, StringSplitOptions.None) + .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}") + : String.Empty; + } + + internal class ProfileOutput + { + public string ProfileName { get; } + + public ProfileOutput(string profileName) + { + ProfileName = profileName; + } + + public override string ToString() => ProfileName != NoProfiles ? $"[{typeof(ProfileAttribute).ToPsAttributeType()}('{ProfileName}')]{Environment.NewLine}" : String.Empty; + } + + internal class DescriptionOutput + { + public string Description { get; } + + public DescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) ? $"[{typeof(DescriptionAttribute).ToPsAttributeType()}('{Description.ToPsStringLiteral()}')]{Environment.NewLine}" : String.Empty; + } + + internal class ParameterCategoryOutput + { + public ParameterCategory Category { get; } + + public ParameterCategoryOutput(ParameterCategory category) + { + Category = category; + } + + public override string ToString() => $"{Indent}[{typeof(CategoryAttribute).ToPsAttributeType()}('{Category}')]{Environment.NewLine}"; + } + + internal class InfoOutput + { + public InfoAttribute Info { get; } + public Type ParameterType { get; } + + public InfoOutput(InfoAttribute info, Type parameterType) + { + Info = info; + ParameterType = parameterType; + } + + public override string ToString() + { + // Rendering of InfoAttribute members that are not used currently + /*var serializedNameText = Info.SerializedName != null ? $"SerializedName='{Info.SerializedName}'" : String.Empty; + var readOnlyText = Info.ReadOnly ? "ReadOnly" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(Info.Description) ? $"Description='{Info.Description.ToPsStringLiteral()}'" : String.Empty;*/ + + var requiredText = Info.Required ? "Required" : String.Empty; + var unwrappedType = ParameterType.Unwrap(); + var hasValidPossibleTypes = Info.PossibleTypes.Any(pt => pt != unwrappedType); + var possibleTypesText = hasValidPossibleTypes + ? $"PossibleTypes=({Info.PossibleTypes.Select(pt => $"[{pt.ToPsType()}]").JoinIgnoreEmpty(ItemSeparator)})" + : String.Empty; + var propertyText = new[] { /*serializedNameText, */requiredText,/* readOnlyText,*/ possibleTypesText/*, descriptionText*/ }.JoinIgnoreEmpty(ItemSeparator); + return hasValidPossibleTypes ? $"{Indent}[{typeof(InfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class PropertySyntaxOutput + { + public string ParameterName { get; } + public Type ParameterType { get; } + public bool IsMandatory { get; } + public int? Position { get; } + + public bool IncludeSpace { get; } + public bool IncludeDash { get; } + + public PropertySyntaxOutput(Parameter parameter) + { + ParameterName = parameter.ParameterName; + ParameterType = parameter.ParameterType; + IsMandatory = parameter.IsMandatory; + Position = parameter.Position; + IncludeSpace = true; + IncludeDash = true; + } + + public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) + { + ParameterName = complexInterfaceInfo.Name; + ParameterType = complexInterfaceInfo.Type; + IsMandatory = complexInterfaceInfo.Required; + Position = null; + IncludeSpace = false; + IncludeDash = false; + } + + public override string ToString() + { + var leftOptional = !IsMandatory ? "[" : String.Empty; + var leftPositional = Position != null ? "[" : String.Empty; + var rightPositional = Position != null ? "]" : String.Empty; + var type = ParameterType != typeof(SwitchParameter) ? $" <{ParameterType.ToSyntaxTypeName()}>" : String.Empty; + var rightOptional = !IsMandatory ? "]" : String.Empty; + var space = IncludeSpace ? " " : String.Empty; + var dash = IncludeDash ? "-" : String.Empty; + return $"{space}{leftOptional}{leftPositional}{dash}{ParameterName}{rightPositional}{type}{rightOptional}"; + } + } + + internal static class PsProxyOutputExtensions + { + public const string NoParameters = "__NoParameters"; + + public const string AllParameterSets = "__AllParameterSets"; + + public const string HalfIndent = " "; + + public const string Indent = HalfIndent + HalfIndent; + + public const string ItemSeparator = ", "; + + public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.{Environment.NewLine}{Environment.NewLine}"; + + public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}"; + + public static string ToPsType(this Type type) + { + var regex = new Regex(@"^(.*)`{1}\d+(.*)$"); + var typeText = type.ToString(); + var match = regex.Match(typeText); + return match.Success ? $"{match.Groups[1]}{match.Groups[2]}" : typeText; + } + + public static string ToPsAttributeType(this Type type) => type.ToPsType().RemoveEnd("Attribute"); + + // https://stackoverflow.com/a/5284606/294804 + private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text; + + public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "
", "\r\n", "\n" }); + + public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty; + + public static string JoinIgnoreEmpty(this IEnumerable values, string separator) => String.Join(separator, values?.Where(v => !String.IsNullOrEmpty(v))); + + // https://stackoverflow.com/a/41961738/294804 + public static string ToSyntaxTypeName(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return $"{type.GetGenericArguments().First().ToSyntaxTypeName()}?"; + } + + if (type.IsGenericType) + { + var genericTypes = String.Join(ItemSeparator, type.GetGenericArguments().Select(ToSyntaxTypeName)); + return $"{type.Name.Split('`').First()}<{genericTypes}>"; + } + + return type.Name; + } + + public static OutputTypeOutput ToOutputTypeOutput(this IEnumerable outputTypes) => new OutputTypeOutput(outputTypes); + + public static CmdletBindingOutput ToCmdletBindingOutput(this VariantGroup variantGroup) => new CmdletBindingOutput(variantGroup); + + public static ParameterOutput ToParameterOutput(this Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) => new ParameterOutput(parameter, hasMultipleVariantsInVariantGroup, hasAllVariantsInParameterGroup); + + public static AliasOutput ToAliasOutput(this string[] aliases, bool includeIndent = false) => new AliasOutput(aliases, includeIndent); + + public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull); + + public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); + + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + + public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); + + public static ParameterTypeOutput ToParameterTypeOutput(this Type parameterType) => new ParameterTypeOutput(parameterType); + + public static ParameterNameOutput ToParameterNameOutput(this string parameterName, bool isLast) => new ParameterNameOutput(parameterName, isLast); + + public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); + + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); + + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); + + public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); + + public static ParameterDescriptionOutput ToParameterDescriptionOutput(this string description) => new ParameterDescriptionOutput(description); + + public static ProfileOutput ToProfileOutput(this string profileName) => new ProfileOutput(profileName); + + public static DescriptionOutput ToDescriptionOutput(this string description) => new DescriptionOutput(description); + + public static ParameterCategoryOutput ToParameterCategoryOutput(this ParameterCategory category) => new ParameterCategoryOutput(category); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this Parameter parameter) => new PropertySyntaxOutput(parameter); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo); + + public static InfoOutput ToInfoOutput(this InfoAttribute info, Type parameterType) => new InfoOutput(info, parameterType); + + public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) + { + string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => + $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; + + var nested = complexInterfaceInfo.NestedInfos.Select(ni => + { + var nestedIndent = $"{currentIndent}{HalfIndent}"; + return ni.IsComplexInterface + ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) + : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, !isFirst && includeBackticks)); + return String.Join(Environment.NewLine, nested); + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..123c0e09ba48 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -0,0 +1,514 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal class ProfileGroup + { + public string ProfileName { get; } + public Variant[] Variants { get; } + public string ProfileFolder { get; } + + public ProfileGroup(Variant[] variants, string profileName = NoProfiles) + { + ProfileName = profileName; + Variants = variants; + ProfileFolder = ProfileName != NoProfiles ? ProfileName : String.Empty; + } + } + + internal class VariantGroup + { + public string ModuleName { get; } + + public string RootModuleName {get => @"";} + public string CmdletName { get; } + public string CmdletVerb { get; } + public string CmdletNoun { get; } + public string ProfileName { get; } + public Variant[] Variants { get; } + public ParameterGroup[] ParameterGroups { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + + public string[] Aliases { get; } + public PSTypeName[] OutputTypes { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + public string DefaultParameterSetName { get; } + public bool HasMultipleVariants { get; } + public PsHelpInfo HelpInfo { get; } + public bool IsGenerated { get; } + public bool IsInternal { get; } + + public string OutputFolder { get; } + public string FileName { get; } + public string FilePath { get; } + + public CommentInfo CommentInfo { get; } + + public VariantGroup(string moduleName, string cmdletName, Variant[] variants, string outputFolder, string profileName = NoProfiles, bool isTest = false, bool isInternal = false) + { + ModuleName = moduleName; + CmdletName = cmdletName; + var cmdletNameParts = CmdletName.Split('-'); + CmdletVerb = cmdletNameParts.First(); + CmdletNoun = cmdletNameParts.Last(); + ProfileName = profileName; + Variants = variants; + ParameterGroups = Variants.ToParameterGroups().OrderBy(pg => pg.OrderCategory).ThenByDescending(pg => pg.IsMandatory).ToArray(); + var aliasDuplicates = ParameterGroups.SelectMany(pg => pg.Aliases) + //https://stackoverflow.com/a/18547390/294804 + .GroupBy(a => a).Where(g => g.Count() > 1).Select(g => g.Key).ToArray(); + if (aliasDuplicates.Any()) + { + throw new ParsingMetadataException($"The alias(es) [{String.Join(", ", aliasDuplicates)}] are defined on multiple parameters for cmdlet '{CmdletName}', which is not supported."); + } + ComplexInterfaceInfos = ParameterGroups.Where(pg => !pg.DontShow && pg.IsComplexInterface).OrderBy(pg => pg.ParameterName).Select(pg => pg.ComplexInterfaceInfo).ToArray(); + + Aliases = Variants.SelectMany(v => v.Attributes).ToAliasNames().ToArray(); + OutputTypes = Variants.SelectMany(v => v.Info.OutputType).Where(ot => ot.Type != null).GroupBy(ot => ot.Type).Select(otg => otg.First()).ToArray(); + SupportsShouldProcess = Variants.Any(v => v.SupportsShouldProcess); + SupportsPaging = Variants.Any(v => v.SupportsPaging); + DefaultParameterSetName = DetermineDefaultParameterSetName(); + HasMultipleVariants = Variants.Length > 1; + HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); + IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); + IsInternal = isInternal; + + OutputFolder = outputFolder; + FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; + FilePath = Path.Combine(OutputFolder, FileName); + + CommentInfo = new CommentInfo(this); + } + + private string DetermineDefaultParameterSetName() + { + var defaultParameterSet = Variants + .Select(v => v.Metadata.DefaultParameterSetName) + .LastOrDefault(dpsn => dpsn.IsValidDefaultParameterSetName()); + + if (String.IsNullOrEmpty(defaultParameterSet)) + { + var variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); + var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); + defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; + } + + return defaultParameterSet; + } + } + + internal class Variant + { + public string CmdletName { get; } + public string VariantName { get; } + public CommandInfo Info { get; } + public CommandMetadata Metadata { get; } + public PsHelpInfo HelpInfo { get; } + public bool HasParameterSets { get; } + public bool IsFunction { get; } + public string PrivateModuleName { get; } + public string PrivateCmdletName { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public Attribute[] Attributes { get; } + public Parameter[] Parameters { get; } + public Parameter[] CmdletOnlyParameters { get; } + public bool IsInternal { get; } + public bool IsDoNotExport { get; } + public string[] Profiles { get; } + + public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) + { + CmdletName = cmdletName; + VariantName = variantName; + Info = info; + HelpInfo = helpInfo ?? new PsHelpInfo(); + Metadata = metadata; + HasParameterSets = hasParameterSets; + IsFunction = Info.CommandType == CommandTypes.Function; + PrivateModuleName = Info.Source; + PrivateCmdletName = Metadata.Name; + SupportsShouldProcess = Metadata.SupportsShouldProcess; + SupportsPaging = Metadata.SupportsPaging; + + Attributes = this.ToAttributes(); + Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); + IsInternal = Attributes.OfType().Any(); + IsDoNotExport = Attributes.OfType().Any(); + CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); + Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); + } + } + + internal class ParameterGroup + { + public string ParameterName { get; } + public Parameter[] Parameters { get; } + + public string[] VariantNames { get; } + public string[] AllVariantNames { get; } + public bool HasAllVariants { get; } + public Type ParameterType { get; } + public string Description { get; } + + public string[] Aliases { get; } + public bool HasValidateNotNull { get; } + public bool HasAllowEmptyArray { get; } + public CompleterInfo CompleterInfo { get; } + public DefaultInfo DefaultInfo { get; } + public bool HasDefaultInfo { get; } + public ParameterCategory OrderCategory { get; } + public bool DontShow { get; } + public bool IsMandatory { get; } + public bool SupportsWildcards { get; } + public bool IsComplexInterface { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public InfoAttribute InfoAttribute { get; } + + public int? FirstPosition { get; } + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public bool IsInputType { get; } + + public ParameterGroup(string parameterName, Parameter[] parameters, string[] allVariantNames) + { + ParameterName = parameterName; + Parameters = parameters; + + VariantNames = Parameters.Select(p => p.VariantName).ToArray(); + AllVariantNames = allVariantNames; + HasAllVariants = VariantNames.Any(vn => vn == AllParameterSets) || !AllVariantNames.Except(VariantNames).Any(); + var types = Parameters.Select(p => p.ParameterType).Distinct().ToArray(); + if (types.Length > 1) + { + throw new ParsingMetadataException($"The parameter '{ParameterName}' has multiple parameter types [{String.Join(", ", types.Select(t => t.Name))}] defined, which is not supported."); + } + ParameterType = types.First(); + Description = Parameters.Select(p => p.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + + Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray(); + HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); + DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) + ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); + HasDefaultInfo = DefaultInfo != null && !String.IsNullOrEmpty(DefaultInfo.Script); + // When DefaultInfo is present, force all parameters from this group to be optional. + if (HasDefaultInfo) + { + foreach (var parameter in Parameters) + { + parameter.IsMandatory = false; + } + } + OrderCategory = Parameters.Select(p => p.OrderCategory).Distinct().DefaultIfEmpty(ParameterCategory.Body).Min(); + DontShow = Parameters.All(p => p.DontShow); + IsMandatory = HasAllVariants && Parameters.Any(p => p.IsMandatory); + SupportsWildcards = Parameters.Any(p => p.SupportsWildcards); + IsComplexInterface = Parameters.Any(p => p.IsComplexInterface); + ComplexInterfaceInfo = Parameters.Where(p => p.IsComplexInterface).Select(p => p.ComplexInterfaceInfo).FirstOrDefault(); + InfoAttribute = Parameters.Select(p => p.InfoAttribute).First(); + + FirstPosition = Parameters.Select(p => p.Position).FirstOrDefault(p => p != null); + ValueFromPipeline = Parameters.Any(p => p.ValueFromPipeline); + ValueFromPipelineByPropertyName = Parameters.Any(p => p.ValueFromPipelineByPropertyName); + IsInputType = ValueFromPipeline || ValueFromPipelineByPropertyName; + } + } + + internal class Parameter + { + public string VariantName { get; } + public string ParameterName { get; } + public ParameterMetadata Metadata { get; } + public PsParameterHelpInfo HelpInfo { get; } + public Type ParameterType { get; } + + public Attribute[] Attributes { get; } + public ParameterCategory[] Categories { get; } + public ParameterCategory OrderCategory { get; } + public PSDefaultValueAttribute DefaultValueAttribute { get; } + public DefaultInfoAttribute DefaultInfoAttribute { get; } + public ParameterAttribute ParameterAttribute { get; } + public bool SupportsWildcards { get; } + public CompleterInfoAttribute CompleterInfoAttribute { get; } + public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public int? Position { get; } + public bool DontShow { get; } + public bool IsMandatory { get; set; } + + public InfoAttribute InfoAttribute { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public bool IsComplexInterface { get; } + public string Description { get; } + + public Parameter(string variantName, string parameterName, ParameterMetadata metadata, PsParameterHelpInfo helpInfo = null) + { + VariantName = variantName; + ParameterName = parameterName; + Metadata = metadata; + HelpInfo = helpInfo ?? new PsParameterHelpInfo(); + + Attributes = Metadata.Attributes.ToArray(); + ParameterType = Attributes.OfType().FirstOrDefault()?.Type ?? Metadata.ParameterType; + Categories = Attributes.OfType().SelectMany(ca => ca.Categories).Distinct().ToArray(); + OrderCategory = Categories.DefaultIfEmpty(ParameterCategory.Body).Min(); + DefaultValueAttribute = Attributes.OfType().FirstOrDefault(); + DefaultInfoAttribute = Attributes.OfType().FirstOrDefault(); + ParameterAttribute = Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == VariantName || pa.ParameterSetName == AllParameterSets); + if (ParameterAttribute == null) + { + throw new ParsingMetadataException($"The variant '{VariantName}' has multiple parameter sets defined, which is not supported."); + } + SupportsWildcards = Attributes.OfType().Any(); + CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + + ValueFromPipeline = ParameterAttribute.ValueFromPipeline; + ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; + Position = ParameterAttribute.Position == Int32.MinValue ? (int?)null : ParameterAttribute.Position; + DontShow = ParameterAttribute.DontShow; + IsMandatory = ParameterAttribute.Mandatory; + + var complexParameterName = ParameterName.ToUpperInvariant(); + var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; + // Remove the complex type message as it will be reinserted if this is a complex type + description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + // Make an InfoAttribute for processing only if one isn't provided + InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; + // Set the description if the InfoAttribute does not have one since they are exported without a description + InfoAttribute.Description = String.IsNullOrEmpty(InfoAttribute.Description) ? description : InfoAttribute.Description; + ComplexInterfaceInfo = InfoAttribute.ToComplexInterfaceInfo(complexParameterName, ParameterType, true); + IsComplexInterface = ComplexInterfaceInfo.IsComplexInterface; + Description = $"{description}{(IsComplexInterface ? complexMessage : String.Empty)}"; + } + } + + internal class ComplexInterfaceInfo + { + public InfoAttribute InfoAttribute { get; } + + public string Name { get; } + public Type Type { get; } + public bool Required { get; } + public bool ReadOnly { get; } + public string Description { get; } + + public ComplexInterfaceInfo[] NestedInfos { get; } + public bool IsComplexInterface { get; } + + public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, bool? required, List seenTypes) + { + Name = name; + Type = type; + InfoAttribute = infoAttribute; + + Required = required ?? InfoAttribute.Required; + ReadOnly = InfoAttribute.ReadOnly; + Description = InfoAttribute.Description.ToPsSingleLine(); + + var unwrappedType = Type.Unwrap(); + var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; + (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + unwrappedType.GetInterfaces() + .Concat(InfoAttribute.PossibleTypes) + .SelectMany(pt => pt.GetProperties() + .SelectMany(pi => pi.GetCustomAttributes(true).OfType() + .Select(ia => ia.ToComplexInterfaceInfo(pi.Name, pi.PropertyType, seenTypes: seenTypes)))) + .Where(cii => !cii.ReadOnly).OrderByDescending(cii => cii.Required).ToArray(); + // https://stackoverflow.com/a/503359/294804 + var associativeArrayInnerType = Type.GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>)) + ?.GetTypeInfo().GetGenericArguments().First(); + if (!hasBeenSeen && associativeArrayInnerType != null) + { + var anyInfo = new InfoAttribute { Description = "This indicates any property can be added to this object." }; + NestedInfos = NestedInfos.Prepend(anyInfo.ToComplexInterfaceInfo("(Any)", associativeArrayInnerType)).ToArray(); + } + IsComplexInterface = NestedInfos.Any(); + } + } + + internal class CommentInfo + { + public string Description { get; } + public string Synopsis { get; } + + public string[] Examples { get; } + public string[] Inputs { get; } + public string[] Outputs { get; } + + public string OnlineVersion { get; } + public string[] RelatedLinks { get; } + + private const string HelpLinkPrefix = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public CommentInfo(VariantGroup variantGroup) + { + var helpInfo = variantGroup.HelpInfo; + Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() + ?? helpInfo.Description.EmptyIfNull(); + // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. + var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; + Synopsis = synopsis.NullIfEmpty() ?? Description; + + Examples = helpInfo.Examples.Select(rl => rl.Code).ToArray(); + + Inputs = (variantGroup.ParameterGroups.Where(pg => pg.IsInputType).Select(pg => pg.ParameterType.FullName).ToArray().NullIfEmpty() ?? + helpInfo.InputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(it => it.Name).ToArray()) + .Where(i => i != "None").Distinct().OrderBy(i => i).ToArray(); + Outputs = (variantGroup.OutputTypes.Select(ot => ot.Type.FullName).ToArray().NullIfEmpty() ?? + helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) + .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); + + // Use root module name in the help link + var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); + OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; + RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + } + } + + internal class CompleterInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public Type Type { get; } + public bool IsTypeCompleter { get; } + + public CompleterInfo(CompleterInfoAttribute infoAttribute) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + } + + public CompleterInfo(ArgumentCompleterAttribute completerAttribute) + { + Script = completerAttribute.ScriptBlock?.ToString(); + if (completerAttribute.Type != null) + { + Type = completerAttribute.Type; + IsTypeCompleter = true; + } + } + } + + internal class DefaultInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public ParameterGroup ParameterGroup { get; } + + public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + ParameterGroup = parameterGroup; + } + + public DefaultInfo(PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) + { + Description = defaultValueAttribute.Help; + ParameterGroup = parameterGroup; + if (defaultValueAttribute.Value != null) + { + Script = defaultValueAttribute.Value.ToString(); + } + } + } + + internal static class PsProxyTypeExtensions + { + public const string NoProfiles = "__NoProfiles"; + + public static bool IsValidDefaultParameterSetName(this string parameterSetName) => + !String.IsNullOrEmpty(parameterSetName) && parameterSetName != AllParameterSets; + + public static Variant[] ToVariants(this CommandInfo info, PsHelpInfo helpInfo) + { + var metadata = new CommandMetadata(info); + var privateCmdletName = metadata.Name.Split('!').First(); + var parts = privateCmdletName.Split('_'); + return parts.Length > 1 + ? new[] { new Variant(parts[0], parts[1], info, metadata, helpInfo: helpInfo) } + // Process multiple parameter sets, so we declare a variant per parameter set. + : info.ParameterSets.Select(ps => new Variant(privateCmdletName, ps.Name, info, metadata, true, helpInfo)).ToArray(); + } + + public static Variant[] ToVariants(this CmdletAndHelpInfo info) => info.CommandInfo.ToVariants(info.HelpInfo); + + public static Variant[] ToVariants(this CommandInfo info, PSObject helpInfo = null) => info.ToVariants(helpInfo?.ToPsHelpInfo()); + + public static Parameter[] ToParameters(this Variant variant) + { + var parameters = variant.Metadata.Parameters.AsEnumerable(); + var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable(); + + if (variant.HasParameterSets) + { + parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets)); + parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); + } + var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); + if (variant.SupportsPaging) { + // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters + variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; + variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; + result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First"))); + result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip"))); + } + return result.ToArray(); + } + + public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction + ? ((FunctionInfo)variant.Info).ScriptBlock.Attributes.ToArray() + : variant.Metadata.CommandType.GetCustomAttributes(false).Cast().ToArray(); + + public static IEnumerable ToParameterGroups(this Variant[] variants) + { + var allVariantNames = variants.Select(vg => vg.VariantName).ToArray(); + return variants + .SelectMany(v => v.Parameters) + .GroupBy(p => p.ParameterName, StringComparer.InvariantCultureIgnoreCase) + .Select(pg => new ParameterGroup(pg.Key, pg.Select(p => p).ToArray(), allVariantNames)); + } + + public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute infoAttribute, string name, Type type, bool? required = null, List seenTypes = null) + => new ComplexInterfaceInfo(name, type, infoAttribute, required, seenTypes); + + public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); + public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); + + public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); + public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/datamigration/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..e435735da120 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/PsAttributes.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration +{ + [AttributeUsage(AttributeTargets.Class)] + public class DescriptionAttribute : Attribute + { + public string Description { get; } + + public DescriptionAttribute(string description) + { + Description = description; + } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class InternalExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class GeneratedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotFormatAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class ProfileAttribute : Attribute + { + public string[] Profiles { get; } + + public ProfileAttribute(params string[] profiles) + { + Profiles = profiles; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class CategoryAttribute : Attribute + { + public ParameterCategory[] Categories { get; } + + public CategoryAttribute(params ParameterCategory[] categories) + { + Categories = categories; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ExportAsAttribute : Attribute + { + public Type Type { get; set; } + + public ExportAsAttribute(Type type) + { + Type = type; + } + } + + public enum ParameterCategory + { + // Note: Order is significant + Uri = 0, + Path, + Query, + Header, + Cookie, + Body, + Azure, + Runtime + } + + [AttributeUsage(AttributeTargets.Property)] + public class OriginAttribute : Attribute + { + public PropertyOrigin Origin { get; } + + public OriginAttribute(PropertyOrigin origin) + { + Origin = origin; + } + } + + public enum PropertyOrigin + { + // Note: Order is significant + Inherited = 0, + Owned, + Inlined + } + + [AttributeUsage(AttributeTargets.Property)] + public class FormatTableAttribute : Attribute + { + public int Index { get; set; } = -1; + public bool HasIndex => Index != -1; + public string Label { get; set; } + public int Width { get; set; } = -1; + public bool HasWidth => Width != -1; + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/datamigration/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..146f7f2fac38 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/PsExtensions.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal static class PsExtensions + { + // https://stackoverflow.com/a/863944/294804 + // https://stackoverflow.com/a/4452598/294804 + // https://stackoverflow.com/a/28701974/294804 + // Note: This will unwrap nested collections, but we don't generate nested collections. + public static Type Unwrap(this Type type) + { + if (type.IsArray) + { + return type.GetElementType().Unwrap(); + } + + var typeInfo = type.GetTypeInfo(); + if (typeInfo.IsGenericType + && (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>) || typeof(IEnumerable<>).IsAssignableFrom(type))) + { + return typeInfo.GetGenericArguments().First().Unwrap(); + } + + return type; + } + + // https://stackoverflow.com/a/863944/294804 + private static bool IsSimple(this Type type) + { + var typeInfo = type.GetTypeInfo(); + return typeInfo.IsPrimitive + || typeInfo.IsEnum + || type == typeof(string) + || type == typeof(decimal); + } + + // https://stackoverflow.com/a/32025393/294804 + private static bool HasImplicitConversion(this Type baseType, Type targetType) => + baseType.GetMethods(BindingFlags.Public | BindingFlags.Static) + .Where(mi => mi.Name == "op_Implicit" && mi.ReturnType == targetType) + .Any(mi => mi.GetParameters().FirstOrDefault()?.ParameterType == baseType); + + public static bool IsPsSimple(this Type type) + { + var unwrappedType = type.Unwrap(); + return unwrappedType.IsSimple() + || unwrappedType == typeof(SwitchParameter) + || unwrappedType == typeof(Hashtable) + || unwrappedType == typeof(PSCredential) + || unwrappedType == typeof(ScriptBlock) + || unwrappedType == typeof(DateTime) + || unwrappedType == typeof(Uri) + || unwrappedType.HasImplicitConversion(typeof(string)); + } + + public static string ToPsList(this IEnumerable items) => String.Join(", ", items.Select(i => $"'{i}'")); + + public static IEnumerable ToAliasNames(this IEnumerable attributes) => attributes.OfType().SelectMany(aa => aa.AliasNames).Distinct(); + + public static bool IsArrayAndElementTypeIsT(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return itemType.IsArray && !tType.IsArray && tType.IsAssignableFrom(itemType.GetElementType()); + } + + public static bool IsTArrayAndElementTypeIsItem(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return !itemType.IsArray && tType.IsArray && (tType.GetElementType()?.IsAssignableFrom(itemType) ?? false); + } + + public static bool IsTypeOrArrayOfType(this object item) => item is T || item.IsArrayAndElementTypeIsT() || item.IsTArrayAndElementTypeIsItem(); + + public static T NormalizeArrayType(this object item) + { + if (item is T result) + { + return result; + } + + if (item.IsArrayAndElementTypeIsT()) + { + var array = (T[])Convert.ChangeType(item, typeof(T[])); + return array.FirstOrDefault(); + } + + if (item.IsTArrayAndElementTypeIsItem()) + { + var tType = typeof(T); + var array = Array.CreateInstance(tType.GetElementType(), 1); + array.SetValue(item, 0); + return (T)Convert.ChangeType(array, tType); + } + + return default(T); + } + + public static T GetNestedProperty(this PSObject psObject, params string[] names) => psObject.Properties.GetNestedProperty(names); + + public static T GetNestedProperty(this PSMemberInfoCollection properties, params string[] names) + { + var lastName = names.Last(); + var nestedProperties = names.Take(names.Length - 1).Aggregate(properties, (p, n) => p?.GetProperty(n)?.Properties); + return nestedProperties != null ? nestedProperties.GetProperty(lastName) : default(T); + } + + public static T GetProperty(this PSObject psObject, string name) => psObject.Properties.GetProperty(name); + + public static T GetProperty(this PSMemberInfoCollection properties, string name) + { + switch (properties[name]?.Value) + { + case PSObject psObject when psObject.BaseObject is PSCustomObject && psObject.ImmediateBaseObject.IsTypeOrArrayOfType(): + return psObject.ImmediateBaseObject.NormalizeArrayType(); + case PSObject psObject when psObject.BaseObject.IsTypeOrArrayOfType(): + return psObject.BaseObject.NormalizeArrayType(); + case object value when value.IsTypeOrArrayOfType(): + return value.NormalizeArrayType(); + default: + return default(T); + } + } + + public static IEnumerable RunScript(this PSCmdlet cmdlet, string script) + => PsHelpers.RunScript(cmdlet.InvokeCommand, script); + + public static void RunScript(this PSCmdlet cmdlet, string script) + => cmdlet.RunScript(script); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, string script) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, script); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, string script) + => engineIntrinsics.RunScript(script); + + public static IEnumerable RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => PsHelpers.RunScript(cmdlet.InvokeCommand, block.ToString()); + + public static void RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => cmdlet.RunScript(block.ToString()); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, block.ToString()); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => engineIntrinsics.RunScript(block.ToString()); + + /// + /// Returns if a parameter should be hidden by checking for . + /// + /// A PowerShell parameter. + public static bool IsHidden(this Parameter parameter) + { + return parameter.Attributes.Any(attr => attr is DoNotExportAttribute); + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/datamigration/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..e11c794efa86 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/PsHelpers.cs @@ -0,0 +1,104 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using Pwsh = System.Management.Automation.PowerShell; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal static class PsHelpers + { + public static IEnumerable RunScript(string script) + => Pwsh.Create().AddScript(script).Invoke(); + + public static void RunScript(string script) + => RunScript(script); + + public static IEnumerable RunScript(CommandInvocationIntrinsics cii, string script) + => cii.InvokeScript(script).Select(o => o?.BaseObject).Where(o => o != null).OfType(); + + public static void RunScript(CommandInvocationIntrinsics cii, string script) + => RunScript(cii, script); + + public static IEnumerable GetModuleCmdlets(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletsCommand = String.Join(" + ", modulePaths.Select(mp => $"(Get-Command -Module (Import-Module '{mp}' -PassThru))")); + return (cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand)) + .Where(ci => ci.CommandType != CommandTypes.Alias); + } + + public static IEnumerable GetModuleCmdlets(params string[] modulePaths) + => GetModuleCmdlets(null, modulePaths); + + public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) + { + // https://stackoverflow.com/a/40969712/294804 + var getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path '{scriptFolder}' -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} +"; + return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); + } + + public static IEnumerable GetScriptCmdlets(string scriptFolder) + => GetScriptCmdlets(null, scriptFolder); + + public static IEnumerable GetScriptHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var importModules = String.Join(Environment.NewLine, modulePaths.Select(mp => $"Import-Module '{mp}'")); + var getHelpCommand = $@" +$currentFunctions = Get-ChildItem function: +{importModules} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} | ForEach-Object {{ Get-Help -Name $_.Name -Full }} +"; + return cmdlet?.RunScript(getHelpCommand) ?? RunScript(getHelpCommand); + } + + public static IEnumerable GetScriptHelpInfo(params string[] modulePaths) + => GetScriptHelpInfo(null, modulePaths); + + public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" + )); + return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) + .Select(h => new CmdletAndHelpInfo { CommandInfo = (h["CommandInfo"] as PSObject)?.BaseObject as CommandInfo, HelpInfo = h["HelpInfo"] as PSObject }); + } + + public static IEnumerable GetModuleCmdletsAndHelpInfo(params string[] modulePaths) + => GetModuleCmdletsAndHelpInfo(null, modulePaths); + + public static CmdletAndHelpInfo ToCmdletAndHelpInfo(this CommandInfo commandInfo, PSObject helpInfo) => new CmdletAndHelpInfo { CommandInfo = commandInfo, HelpInfo = helpInfo }; + + public const string Psd1Indent = " "; + public const string GuidStart = Psd1Indent + "GUID"; + + public static Guid ReadGuidFromPsd1(string psd1Path) + { + var guid = Guid.NewGuid(); + if (File.Exists(psd1Path)) + { + var currentGuid = File.ReadAllLines(psd1Path) + .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault()?.Replace("'", String.Empty); + guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; + } + + return guid; + } + } + + internal class CmdletAndHelpInfo + { + public CommandInfo CommandInfo { get; set; } + public PSObject HelpInfo { get; set; } + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/datamigration/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..1e5fb8fda04c --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/StringExtensions.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal static class StringExtensions + { + public static string NullIfEmpty(this string text) => String.IsNullOrEmpty(text) ? null : text; + public static string NullIfWhiteSpace(this string text) => String.IsNullOrWhiteSpace(text) ? null : text; + public static string EmptyIfNull(this string text) => text ?? String.Empty; + + public static bool? ToNullableBool(this string text) => String.IsNullOrEmpty(text) ? (bool?)null : Convert.ToBoolean(text.ToLowerInvariant()); + + public static string ToUpperFirstCharacter(this string text) => String.IsNullOrEmpty(text) ? text : $"{text[0].ToString().ToUpperInvariant()}{text.Remove(0, 1)}"; + + public static string ReplaceNewLines(this string value, string replacer = " ", string[] newLineSymbols = null) + => (newLineSymbols ?? new []{ "\r\n", "\n" }).Aggregate(value.EmptyIfNull(), (current, symbol) => current.Replace(symbol, replacer)); + public static string NormalizeNewLines(this string value) => value.ReplaceNewLines("\u00A0").Replace("\u00A0", Environment.NewLine); + } +} diff --git a/swaggerci/datamigration/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/datamigration/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..942df616a7b8 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/BuildTime/XmlExtensions.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal static class XmlExtensions + { + public static string ToXmlString(this T inputObject, bool excludeDeclaration = false) + { + var serializer = new XmlSerializer(typeof(T)); + //https://stackoverflow.com/a/760290/294804 + //https://stackoverflow.com/a/3732234/294804 + var namespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); + var xmlSettings = new XmlWriterSettings { OmitXmlDeclaration = excludeDeclaration, Indent = true }; + using (var stringWriter = new StringWriter()) + using (var xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + serializer.Serialize(xmlWriter, inputObject, namespaces); + return stringWriter.ToString(); + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/CmdInfoHandler.cs b/swaggerci/datamigration/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..29080df7f1c8 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/Conversions/ConversionException.cs b/swaggerci/datamigration/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..a09bce783823 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..2d21a43521b0 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..e59a2fe8275e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/BinaryConverter.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..8878753a3ff2 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..22ad2ef013be --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..2b4de3d43217 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..330cd188372d --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..c0248fb9d51a --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..7085c32df433 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/EnumConverter.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..4c0e90758d4e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..ad41cc77b774 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/HashSet'1Converter.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..28e0d06fc054 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..e760cdbdc43a --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..07aa71e2d8e6 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..6cd18224eb4e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..a8e8d517b442 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..65759eb47976 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..70b923ed32f6 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..9cffc353222b --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..e7ee203aee0e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..1b2d784f6237 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..701551658f7b --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..1c2fe048f4fc --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..2d989cc55fe7 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/datamigration/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..ebfa91c213ca --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/datamigration/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..8a1a5f56d465 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/JsonConverterFactory.cs @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/datamigration/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..06137eb38148 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/datamigration/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..94eec8dbe5c5 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/JsonArray.cs b/swaggerci/datamigration/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..158d7e36080a --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/datamigration/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..d2969570b061 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/JsonNode.cs b/swaggerci/datamigration/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..5fc747304014 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/datamigration/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..be08562a5902 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/JsonNumber.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/JsonObject.cs b/swaggerci/datamigration/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..39bbf1f62f2e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/JsonObject.cs @@ -0,0 +1,183 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/JsonString.cs b/swaggerci/datamigration/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..dde15857b681 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/datamigration/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..51a8c3b85032 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Debugging.cs b/swaggerci/datamigration/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..b9c2e1939056 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Debugging.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + internal static class AttachDebugger + { + internal static void Break() + { + while (!System.Diagnostics.Debugger.IsAttached) + { + System.Console.Error.WriteLine($"Waiting for debugger to attach to process {System.Diagnostics.Process.GetCurrentProcess().Id}"); + for (int i = 0; i < 50; i++) + { + if (System.Diagnostics.Debugger.IsAttached) + { + break; + } + System.Threading.Thread.Sleep(100); + System.Console.Error.Write("."); + } + System.Console.Error.WriteLine(); + } + System.Diagnostics.Debugger.Break(); + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/DictionaryExtensions.cs b/swaggerci/datamigration/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..b7b9dd7d6f7a --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/DictionaryExtensions.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + internal static class DictionaryExtensions + { + internal static void HashTableToDictionary(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary dictionary) + { + if (null == hashtable) + { + return; + } + foreach (var each in hashtable.Keys) + { + var key = each.ToString(); + var value = hashtable[key]; + if (null != value) + { + try + { + dictionary[key] = (V)value; + } + catch + { + // Values getting dropped; not compatible with target dictionary. Not sure what to do here. + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/EventData.cs b/swaggerci/datamigration/generated/runtime/EventData.cs new file mode 100644 index 000000000000..0cac586443f1 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/EventData.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/EventDataExtensions.cs b/swaggerci/datamigration/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..4812a1245c0b --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/EventDataExtensions.cs @@ -0,0 +1,94 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System; + + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + /// + /// PowerShell-specific data on top of the llc# EventData + /// + /// + /// In PowerShell, we add on the EventDataConverter to support sending events between modules. + /// Obviously, this code would need to be duplcated on both modules. + /// This is preferable to sharing a common library, as versioning makes that problematic. + /// + public partial class EventData : EventArgs + { + } + + /// + /// A PowerShell PSTypeConverter to adapt an EventData object that has been passed. + /// Usually used between modules. + /// + public class EventDataConverter : System.Management.Automation.PSTypeConverter + { + public override bool CanConvertTo(object sourceValue, Type destinationType) => false; + public override object ConvertTo(object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => null; + public override bool CanConvertFrom(dynamic sourceValue, Type destinationType) => destinationType == typeof(EventData) && CanConvertFrom(sourceValue); + public override object ConvertFrom(dynamic sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Verifies that a given object has the required members to convert it to the target type (EventData) + /// + /// Uses a dynamic type so that it is able to use the simplest code without excessive checking. + /// + /// The instance to verify + /// True, if the object has all the required parameters. + public static bool CanConvertFrom(dynamic sourceValue) + { + try + { + // check if this has *required* parameters... + sourceValue?.Id?.GetType(); + sourceValue?.Message?.GetType(); + sourceValue?.Cancel?.GetType(); + + // remaining parameters are not *required*, + // and if they have values, it will copy them at conversion time. + } + catch + { + // if anything throws an exception (because it's null, or doesn't have that member) + return false; + } + return true; + } + + /// + /// Returns result of the delegate as the expected type, or default(T) + /// + /// This isolates any exceptions from the consumer. + /// + /// A delegate that returns a value + /// The desired output type + /// The value from the function if the type is correct + private static T To(Func srcValue) + { + try { return srcValue(); } + catch { return default(T); } + } + + /// + /// Converts an incoming object to the expected type by treating the incoming object as a dynamic, and coping the expected values. + /// + /// the incoming object + /// EventData + public static EventData ConvertFrom(dynamic sourceValue) + { + return new EventData + { + Id = To(() => sourceValue.Id), + Message = To(() => sourceValue.Message), + Parameter = To(() => sourceValue.Parameter), + Value = To(() => sourceValue.Value), + RequestMessage = To(() => sourceValue.RequestMessage), + ResponseMessage = To(() => sourceValue.ResponseMessage), + Cancel = To(() => sourceValue.Cancel) + }; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/EventListener.cs b/swaggerci/datamigration/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..2600ec4059c0 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Events.cs b/swaggerci/datamigration/generated/runtime/Events.cs new file mode 100644 index 000000000000..13ec9b073129 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Events.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/EventsExtensions.cs b/swaggerci/datamigration/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..6822870c7919 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/EventsExtensions.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + public static partial class Events + { + public const string CmdletProcessRecordStart = nameof(CmdletProcessRecordStart); + public const string CmdletProcessRecordAsyncStart = nameof(CmdletProcessRecordAsyncStart); + public const string CmdletException = nameof(CmdletException); + public const string CmdletGetPipeline = nameof(CmdletGetPipeline); + public const string CmdletBeforeAPICall = nameof(CmdletBeforeAPICall); + public const string CmdletBeginProcessing = nameof(CmdletBeginProcessing); + public const string CmdletEndProcessing = nameof(CmdletEndProcessing); + public const string CmdletProcessRecordEnd = nameof(CmdletProcessRecordEnd); + public const string CmdletProcessRecordAsyncEnd = nameof(CmdletProcessRecordAsyncEnd); + public const string CmdletAfterAPICall = nameof(CmdletAfterAPICall); + + public const string Verbose = nameof(Verbose); + public const string Debug = nameof(Debug); + public const string Information = nameof(Information); + public const string Error = nameof(Error); + public const string Warning = nameof(Warning); + } + +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Extensions.cs b/swaggerci/datamigration/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..1d967e94533e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Extensions.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/datamigration/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..a80365569ac1 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/datamigration/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..254e180f2e3d --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Helpers/Extensions/TypeExtensions.cs @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Helpers/Seperator.cs b/swaggerci/datamigration/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..d4dbc70e3906 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/datamigration/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..77fccebcb9fd --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Helpers/TypeDetails.cs @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Helpers/XHelper.cs b/swaggerci/datamigration/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..3f53e338d221 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Helpers/XHelper.cs @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/HttpPipeline.cs b/swaggerci/datamigration/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..9984c5ee0ffc --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/HttpPipeline.cs @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + using GetEventData = System.Func; + using NextDelegate = System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + + using SignalDelegate = System.Func, System.Threading.Tasks.Task>; + using GetParameterDelegate = System.Func, string, object>; + using SendAsyncStepDelegate = System.Func, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + using PipelineChangeDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>; + using ModuleLoadPipelineDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + using NewRequestPipelineDelegate = System.Action, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + +/* + public class DelegateBasedEventListener : IEventListener + { + private EventListenerDelegate _listener; + public DelegateBasedEventListener(EventListenerDelegate listener) + { + _listener = listener; + } + public CancellationToken Token => CancellationToken.None; + public System.Action Cancel => () => { }; + + + public Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + return _listener(id, token, () => createMessage()); + } + } +*/ + /// + /// This is a necessary extension to the SendAsyncFactory to support the 'generic' delegate format. + /// + public partial class SendAsyncFactory + { + /// + /// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern. + /// (Provided to support out-of-module delegation for Azure Cmdlets) + /// + /// The Pipeline Step as a delegate + public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) => + step( + request, + listener.Token, + listener.Cancel, + (id, token, getEventData) => listener.Signal(id, token, () => { + var data = EventDataConverter.ConvertFrom( getEventData() ) as EventData; + data.Id = id; + data.Cancel = listener.Cancel; + data.RequestMessage = request; + return data; + }), + (req, token, cancel, listenerDelegate) => next.SendAsync(req, listener)); + } + + public partial class HttpPipeline : ISendAsync + { + public HttpPipeline Append(SendAsyncStepDelegate item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStepDelegate item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/datamigration/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..1e23a2111f42 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/HttpPipelineMocking.ps1 @@ -0,0 +1,110 @@ +$ErrorActionPreference = "Stop" + +# get the recording path +if (-not $TestRecordingFile) { + $TestRecordingFile = Join-Path $PSScriptRoot 'recording.json' +} + +# create the Http Pipeline Recorder +$Mock = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PipelineMock $TestRecordingFile + +# set the recorder to the appropriate mode (default to 'live') +Write-Host -ForegroundColor Green "Running '$TestMode' mode..." +switch ($TestMode) { + 'record' { + Write-Host -ForegroundColor Green "Recording to $TestRecordingFile" + $Mock.SetRecord() + $null = erase -ea 0 $TestRecordingFile + } + 'playback' { + if (-not (Test-Path $TestRecordingFile)) { + Write-Host -fore:yellow "Recording file '$TestRecordingFile' is not present. Tests expecting recorded responses will fail" + } else { + Write-Host -ForegroundColor Green "Using recording $TestRecordingFile" + } + $Mock.SetPlayback() + $Mock.ForceResponseHeaders["Retry-After"] = "0"; + } + default: { + $Mock.SetLive() + } +} + +# overrides for Pester Describe/Context/It + +function Describe( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushDescription($Name) + try { + return pester\Describe -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopDescription() + } +} + +function Context( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushContext($Name) + try { + return pester\Context -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopContext() + } +} + +function It { + [CmdletBinding(DefaultParameterSetName = 'Normal')] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Name, + + [Parameter(Position = 1)] + [ScriptBlock] $Test = { }, + + [System.Collections.IDictionary[]] $TestCases, + + [Parameter(ParameterSetName = 'Pending')] + [Switch] $Pending, + + [Parameter(ParameterSetName = 'Skip')] + [Alias('Ignore')] + [Switch] $Skip + ) + $Mock.PushScenario($Name) + + try { + if ($skip) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Skip + } + if ($pending) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Pending + } + return pester\It -Name $Name -Test $Test -TestCases $TestCases + } + finally { + $null = $Mock.PopScenario() + } +} + +# set the HttpPipelineAppend for all the cmdlets +$PSDefaultParameterValues["*:HttpPipelinePrepend"] = $Mock diff --git a/swaggerci/datamigration/generated/runtime/IAssociativeArray.cs b/swaggerci/datamigration/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..d29e89181aec --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/IAssociativeArray.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/IHeaderSerializable.cs b/swaggerci/datamigration/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..9026011cf15f --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/ISendAsync.cs b/swaggerci/datamigration/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..667e9355450a --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/ISendAsync.cs @@ -0,0 +1,296 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/InfoAttribute.cs b/swaggerci/datamigration/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..c6375959dbfb --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Iso/IsoDate.cs b/swaggerci/datamigration/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..eba8d0e1b9de --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/datamigration/generated/runtime/JsonType.cs b/swaggerci/datamigration/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..f7fc7b3ae762 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/MessageAttribute.cs b/swaggerci/datamigration/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..076931603a3b --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/MessageAttribute.cs @@ -0,0 +1,360 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using System.Text; + + [AttributeUsage(AttributeTargets.All)] + public class GenericBreakingChangeAttribute : Attribute + { + private string _message; + //A dexcription of what the change is about, non mandatory + public string ChangeDescription { get; set; } = null; + + //The version the change is effective from, non mandatory + public string DeprecateByVersion { get; } + public bool DeprecateByVersionSet { get; } = false; + + //The date on which the change comes in effect + public DateTime ChangeInEfectByDate { get; } + public bool ChangeInEfectByDateSet { get; } = false; + + //Old way of calling the cmdlet + public string OldWay { get; set; } + //New way fo calling the cmdlet + public string NewWay { get; set; } + + public GenericBreakingChangeAttribute(string message) + { + _message = message; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + + if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.ChangeInEfectByDate = result; + this.ChangeInEfectByDateSet = true; + } + } + + public DateTime getInEffectByDate() + { + return this.ChangeInEfectByDate.Date; + } + + + /** + * This function prints out the breaking change message for the attribute on the cmdline + * */ + public void PrintCustomAttributeInfo(Action writeOutput) + { + + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + + + if (!string.IsNullOrWhiteSpace(ChangeDescription)) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription)); + } + + if (ChangeInEfectByDateSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); + } + + if (DeprecateByVersionSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + } + + if (OldWay != null && NewWay != null) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay)); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + + protected virtual string GetAttributeSpecificMessage() + { + return _message; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute + { + + public string ReplacementCmdletName { get; set; } + + public CmdletBreakingChangeAttribute() : + base(string.Empty) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + } + + protected override string GetAttributeSpecificMessage() + { + if (string.IsNullOrWhiteSpace(ReplacementCmdletName)) + { + return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement; + } + else + { + return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName); + } + } + } + + [AttributeUsage(AttributeTargets.All)] + public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string[] ChangedParameterSet { set; get; } + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : + base(string.Empty) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + ChangedParameterSet = changedParameterSet; + } + + protected override string GetAttributeSpecificMessage() + { + + return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement; + + } + + public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName) + { + if (ChangedParameterSet != null) + return ChangedParameterSet.Contains(parameterSetName); + return false; + } + + } + + [AttributeUsage(AttributeTargets.All)] + public class PreviewMessageAttribute : Attribute + { + public string _message; + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = message; + } + + public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + { + psCmdlet.WriteWarning(this._message); + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string NameOfParameterChanging { get; } + + public string ReplaceMentCmdletParameterName { get; set; } = null; + + public bool IsBecomingMandatory { get; set; } = false; + + public String OldParamaterType { get; set; } + + public String NewParameterType { get; set; } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : + base(string.Empty) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName)) + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + } + else + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging)); + } + } + + //See if the type of the param is changing + if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType)) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType)); + } + return message.ToString(); + } + + /// + /// See if the bound parameters contain the current parameter, if they do + /// then the attribbute is applicable + /// If the invocationInfo is null we return true + /// + /// + /// bool + public override bool IsApplicableToInvocation(InvocationInfo invocationInfo) + { + bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging); + return applicable.HasValue ? applicable.Value : false; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string DeprecatedCmdLetOutputType { get; } + + //This is still a String instead of a Type as this + //might be undefined at the time of adding the attribute + public string ReplacementCmdletOutputType { get; set; } + + public string[] DeprecatedOutputProperties { get; set; } + + public string[] NewOutputProperties { get; set; } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : + base(string.Empty) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + + //check for the deprecation scenario + if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType)); + } + else + { + if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType)); + } + else + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType)); + } + + if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved); + foreach (string property in DeprecatedOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + + if (NewOutputProperties != null && NewOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded); + foreach (string property in NewOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + } + return message.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/MessageAttributeHelper.cs b/swaggerci/datamigration/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..e14c2f7204d1 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,161 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + public class MessageAttributeHelper + { + public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; + public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And reads all the deprecation attributes attached to it + * Prints a message on the cmdline For each of the attribute found + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + * */ + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + bool supressWarningOrError = false; + + try + { + supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME)); + } + catch (Exception) + { + //no action + } + + if (supressWarningOrError) + { + //Do not process the attributes at runtime... The env variable to override the warning messages is set + return; + } + + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendBreakingChangeInfo = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + } + + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(psCmdlet); + } + } + } + + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And returns all the deprecation attributes attached to it + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + **/ + private static IEnumerable GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet) + { + List attributeList = new List(); + + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + List attributeList = new List(); + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo)); + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/Method.cs b/swaggerci/datamigration/generated/runtime/Method.cs new file mode 100644 index 000000000000..5d64dcdb3071 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Models/JsonMember.cs b/swaggerci/datamigration/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..ce0fba336b28 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Models/JsonMember.cs @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Models/JsonModel.cs b/swaggerci/datamigration/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..19da71b962db --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Models/JsonModelCache.cs b/swaggerci/datamigration/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..82c230fc3d2c --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/datamigration/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..43362a28b748 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/Collections/JsonArray.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..27b4403e9a9c --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XImmutableArray.cs @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..acc034df7858 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XList.cs @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..65cb8bc99330 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..f50276aa2003 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/Collections/XSet.cs @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/datamigration/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..c3f3f5377a05 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/JsonDate.cs b/swaggerci/datamigration/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..a899b14f20eb --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/JsonDate.cs @@ -0,0 +1,173 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/JsonNode.cs b/swaggerci/datamigration/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..5fb751a90b16 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/JsonNode.cs @@ -0,0 +1,250 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/datamigration/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..d08c500fc900 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/JsonNumber.cs @@ -0,0 +1,109 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/JsonObject.cs b/swaggerci/datamigration/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..abbbcde47d02 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/JsonString.cs b/swaggerci/datamigration/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..7ad0cce99ab2 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/XBinary.cs b/swaggerci/datamigration/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..32a5d6650fdb --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Nodes/XNull.cs b/swaggerci/datamigration/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..71c56d281c2c --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/datamigration/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..407467076064 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Parser/Exceptions/ParseException.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Parser/JsonParser.cs b/swaggerci/datamigration/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..53cd46f3ba4c --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Parser/JsonToken.cs b/swaggerci/datamigration/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..56fc6253dc3f --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Parser/JsonToken.cs @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/datamigration/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..85690f0b14c5 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Parser/Location.cs b/swaggerci/datamigration/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..6cdf827e1590 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/datamigration/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..5e4ffc488267 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Parser/TokenReader.cs b/swaggerci/datamigration/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..f71e801a3f86 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/PipelineMocking.cs b/swaggerci/datamigration/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..f9da59bdac25 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/datamigration/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..31346f243b6c --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5633 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.generated.runtime.Properties +{ + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.PowerShell.Cmdlets.DataMigration.generated.runtime.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The remote server returned an error: (401) Unauthorized.. + /// + public static string AccessDeniedExceptionMessage + { + get + { + return ResourceManager.GetString("AccessDeniedExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account id doesn't match one in subscription.. + /// + public static string AccountIdDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account needs to be specified. + /// + public static string AccountNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account "{0}" has been added.. + /// + public static string AddAccountAdded + { + get + { + return ResourceManager.GetString("AddAccountAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To switch to a different subscription, please use Select-AzureSubscription.. + /// + public static string AddAccountChangeSubscription + { + get + { + return ResourceManager.GetString("AddAccountChangeSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".. + /// + public static string AddAccountNonInteractiveGuestOrFpo + { + get + { + return ResourceManager.GetString("AddAccountNonInteractiveGuestOrFpo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription "{0}" is selected as the default subscription.. + /// + public static string AddAccountShowDefaultSubscription + { + get + { + return ResourceManager.GetString("AddAccountShowDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To view all the subscriptions, please use Get-AzureSubscription.. + /// + public static string AddAccountViewSubscriptions + { + get + { + return ResourceManager.GetString("AddAccountViewSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is created successfully.. + /// + public static string AddOnCreatedMessage + { + get + { + return ResourceManager.GetString("AddOnCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on name {0} is already used.. + /// + public static string AddOnNameAlreadyUsed + { + get + { + return ResourceManager.GetString("AddOnNameAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} not found.. + /// + public static string AddOnNotFound + { + get + { + return ResourceManager.GetString("AddOnNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on {0} is removed successfully.. + /// + public static string AddOnRemovedMessage + { + get + { + return ResourceManager.GetString("AddOnRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is updated successfully.. + /// + public static string AddOnUpdatedMessage + { + get + { + return ResourceManager.GetString("AddOnUpdatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}.. + /// + public static string AddRoleMessageCreate + { + get + { + return ResourceManager.GetString("AddRoleMessageCreate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’.. + /// + public static string AddRoleMessageCreateNode + { + get + { + return ResourceManager.GetString("AddRoleMessageCreateNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure".. + /// + public static string AddRoleMessageCreatePHP + { + get + { + return ResourceManager.GetString("AddRoleMessageCreatePHP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator. + /// + public static string AddRoleMessageInsufficientPermissions + { + get + { + return ResourceManager.GetString("AddRoleMessageInsufficientPermissions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A role name '{0}' already exists. + /// + public static string AddRoleMessageRoleExists + { + get + { + return ResourceManager.GetString("AddRoleMessageRoleExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} already has an endpoint with name {1}. + /// + public static string AddTrafficManagerEndpointFailed + { + get + { + return ResourceManager.GetString("AddTrafficManagerEndpointFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. + ///Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable [rest of string was truncated]";. + /// + public static string ARMDataCollectionMessage + { + get + { + return ResourceManager.GetString("ARMDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}.. + /// + public static string AuthenticatingForSingleTenant + { + get + { + return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows Azure Powershell\. + /// + public static string AzureDirectory + { + get + { + return ResourceManager.GetString("AzureDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://manage.windowsazure.com. + /// + public static string AzurePortalUrl + { + get + { + return ResourceManager.GetString("AzurePortalUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PORTAL_URL. + /// + public static string AzurePortalUrlEnv + { + get + { + return ResourceManager.GetString("AzurePortalUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected profile must not be null.. + /// + public static string AzureProfileMustNotBeNull + { + get + { + return ResourceManager.GetString("AzureProfileMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure SDK\{0}\. + /// + public static string AzureSdkDirectory + { + get + { + return ResourceManager.GetString("AzureSdkDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscArchiveAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscArchiveAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find configuration data file: {0}. + /// + public static string AzureVMDscCannotFindConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscCannotFindConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create Archive. + /// + public static string AzureVMDscCreateArchiveAction + { + get + { + return ResourceManager.GetString("AzureVMDscCreateArchiveAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration data must be a .psd1 file. + /// + public static string AzureVMDscInvalidConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscInvalidConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing configuration script: {0}. + /// + public static string AzureVMDscParsingConfiguration + { + get + { + return ResourceManager.GetString("AzureVMDscParsingConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscStorageBlobAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscStorageBlobAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload '{0}'. + /// + public static string AzureVMDscUploadToBlobStorageAction + { + get + { + return ResourceManager.GetString("AzureVMDscUploadToBlobStorageAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution failed because a background thread could not prompt the user.. + /// + public static string BaseShouldMethodFailureReason + { + get + { + return ResourceManager.GetString("BaseShouldMethodFailureReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Uri was empty.. + /// + public static string BaseUriEmpty + { + get + { + return ResourceManager.GetString("BaseUriEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing without ParameterSet.. + /// + public static string BeginProcessingWithoutParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithoutParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing with ParameterSet '{1}'.. + /// + public static string BeginProcessingWithParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blob with the name {0} already exists in the account.. + /// + public static string BlobAlreadyExistsInTheAccount + { + get + { + return ResourceManager.GetString("BlobAlreadyExistsInTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}.blob.core.windows.net/. + /// + public static string BlobEndpointUri + { + get + { + return ResourceManager.GetString("BlobEndpointUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_BLOBSTORAGE_TEMPLATE. + /// + public static string BlobEndpointUriEnv + { + get + { + return ResourceManager.GetString("BlobEndpointUriEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is changing.. + /// + public static string BreakingChangeAttributeParameterChanging + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterChanging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is becoming mandatory.. + /// + public static string BreakingChangeAttributeParameterMandatoryNow + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterMandatoryNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplaced + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplaced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by mandatory parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplacedMandatory + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplacedMandatory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the parameter is changing from '{0}' to '{1}'.. + /// + public static string BreakingChangeAttributeParameterTypeChange + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterTypeChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change description : {0} + ///. + /// + public static string BreakingChangesAttributesChangeDescriptionMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesChangeDescriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet '{0}' is replacing this cmdlet.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type is changing from the existing type :'{0}' to the new type :'{1}'. + /// + public static string BreakingChangesAttributesCmdLetOutputChange1 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "The output type '{0}' is changing". + /// + public static string BreakingChangesAttributesCmdLetOutputChange2 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + ///- The following properties are being added to the output type : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesAdded + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// - The following properties in the output type are being deprecated : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesRemoved + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type '{0}' is being deprecated without a replacement.. + /// + public static string BreakingChangesAttributesCmdLetOutputTypeDeprecated + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputTypeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} + /// + ///. + /// + public static string BreakingChangesAttributesDeclarationMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Cmdlet : '{0}' + /// - {1} + ///. + /// + public static string BreakingChangesAttributesDeclarationMessageWithCmdletName + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessageWithCmdletName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOTE : Go to {0} for steps to suppress (and other related information on) the breaking change messages.. + /// + public static string BreakingChangesAttributesFooterMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesFooterMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Breaking changes in the cmdlet '{0}' :. + /// + public static string BreakingChangesAttributesHeaderMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesHeaderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note : This change will take effect on '{0}' + ///. + /// + public static string BreakingChangesAttributesInEffectByDateMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByDateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ```powershell + ///# Old + ///{0} + /// + ///# New + ///{1} + ///``` + /// + ///. + /// + public static string BreakingChangesAttributesUsageChangeMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet invocation changes : + /// Old Way : {0} + /// New Way : {1}. + /// + public static string BreakingChangesAttributesUsageChangeMessageConsole + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessageConsole", resourceCulture); + } + } + + /// + /// The cmdlet is in experimental stage. The function may not be enabled in current subscription. + /// + public static string ExperimentalCmdletMessage + { + get + { + return ResourceManager.GetString("ExperimentalCmdletMessage", resourceCulture); + } + } + + + + /// + /// Looks up a localized string similar to CACHERUNTIMEURL. + /// + public static string CacheRuntimeUrl + { + get + { + return ResourceManager.GetString("CacheRuntimeUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cache. + /// + public static string CacheRuntimeValue + { + get + { + return ResourceManager.GetString("CacheRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CacheRuntimeVersion. + /// + public static string CacheRuntimeVersionKey + { + get + { + return ResourceManager.GetString("CacheRuntimeVersionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}). + /// + public static string CacheVersionWarningText + { + get + { + return ResourceManager.GetString("CacheVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change built-in environment {0}.. + /// + public static string CannotChangeBuiltinEnvironment + { + get + { + return ResourceManager.GetString("CannotChangeBuiltinEnvironment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find {0} with name {1}.. + /// + public static string CannotFind + { + get + { + return ResourceManager.GetString("CannotFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn't exist. + /// + public static string CannotFindDeployment + { + get + { + return ResourceManager.GetString("CannotFindDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't find valid Microsoft Azure role in current directory {0}. + /// + public static string CannotFindRole + { + get + { + return ResourceManager.GetString("CannotFindRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist. + /// + public static string CannotFindServiceConfigurationFile + { + get + { + return ResourceManager.GetString("CannotFindServiceConfigurationFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders.. + /// + public static string CannotFindServiceRoot + { + get + { + return ResourceManager.GetString("CannotFindServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated.. + /// + public static string CannotUpdateUnknownSubscription + { + get + { + return ResourceManager.GetString("CannotUpdateUnknownSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ManagementCertificate. + /// + public static string CertificateElementName + { + get + { + return ResourceManager.GetString("CertificateElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to certificate.pfx. + /// + public static string CertificateFileName + { + get + { + return ResourceManager.GetString("CertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate imported into CurrentUser\My\{0}. + /// + public static string CertificateImportedMessage + { + get + { + return ResourceManager.GetString("CertificateImportedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. + /// + public static string CertificateNotFoundInStore + { + get + { + return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}. + /// + public static string CertificatePrivateKeyAccessError + { + get + { + return ResourceManager.GetString("CertificatePrivateKeyAccessError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} deployment for {2} service. + /// + public static string ChangeDeploymentStateWaitMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStateWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud service {0} is in {1} state.. + /// + public static string ChangeDeploymentStatusCompleteMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStatusCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing/Removing public environment '{0}' is not allowed.. + /// + public static string ChangePublicEnvironmentMessage + { + get + { + return ResourceManager.GetString("ChangePublicEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} is set to value {1}. + /// + public static string ChangeSettingsElementMessage + { + get + { + return ResourceManager.GetString("ChangeSettingsElementMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing public environment is not supported.. + /// + public static string ChangingDefaultEnvironmentNotSupported + { + get + { + return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose which publish settings file to use:. + /// + public static string ChoosePublishSettingsFile + { + get + { + return ResourceManager.GetString("ChoosePublishSettingsFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel. + /// + public static string ClientDiagnosticLevelName + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string ClientDiagnosticLevelValue + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cloud_package.cspkg. + /// + public static string CloudPackageFileName + { + get + { + return ResourceManager.GetString("CloudPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Cloud.cscfg. + /// + public static string CloudServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("CloudServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-ons for {0}. + /// + public static string CloudServiceDescription + { + get + { + return ResourceManager.GetString("CloudServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive.. + /// + public static string CommunicationCouldNotBeEstablished + { + get + { + return ResourceManager.GetString("CommunicationCouldNotBeEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete. + /// + public static string CompleteMessage + { + get + { + return ResourceManager.GetString("CompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationID : '{0}'. + /// + public static string ComputeCloudExceptionOperationIdMessage + { + get + { + return ResourceManager.GetString("ComputeCloudExceptionOperationIdMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to config.json. + /// + public static string ConfigurationFileName + { + get + { + return ResourceManager.GetString("ConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VirtualMachine creation failed.. + /// + public static string CreateFailedErrorMessage + { + get + { + return ResourceManager.GetString("CreateFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead.. + /// + public static string CreateWebsiteFailed + { + get + { + return ResourceManager.GetString("CreateWebsiteFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core. + /// + public static string DataCacheClientsType + { + get + { + return ResourceManager.GetString("DataCacheClientsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //blobcontainer[@datacenter='{0}']. + /// + public static string DatacenterBlobQuery + { + get + { + return ResourceManager.GetString("DatacenterBlobQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation. + /// + public static string DataCollectionActivity + { + get + { + return ResourceManager.GetString("DataCollectionActivity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose not to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmNo + { + get + { + return ResourceManager.GetString("DataCollectionConfirmNo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This confirmation message will be dismissed in '{0}' second(s).... + /// + public static string DataCollectionConfirmTime + { + get + { + return ResourceManager.GetString("DataCollectionConfirmTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmYes + { + get + { + return ResourceManager.GetString("DataCollectionConfirmYes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The setting profile has been saved to the following path '{0}'.. + /// + public static string DataCollectionSaveFileInformation + { + get + { + return ResourceManager.GetString("DataCollectionSaveFileInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription. + /// + public static string DefaultAndCurrentSubscription + { + get + { + return ResourceManager.GetString("DefaultAndCurrentSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string DefaultFileVersion + { + get + { + return ResourceManager.GetString("DefaultFileVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no hostnames which could be used for validation.. + /// + public static string DefaultHostnamesValidation + { + get + { + return ResourceManager.GetString("DefaultHostnamesValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 8080. + /// + public static string DefaultPort + { + get + { + return ResourceManager.GetString("DefaultPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string DefaultRoleCachingInMB + { + get + { + return ResourceManager.GetString("DefaultRoleCachingInMB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto. + /// + public static string DefaultUpgradeMode + { + get + { + return ResourceManager.GetString("DefaultUpgradeMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 80. + /// + public static string DefaultWebPort + { + get + { + return ResourceManager.GetString("DefaultWebPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete + { + get + { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for service {1} is already in {2} state. + /// + public static string DeploymentAlreadyInState + { + get + { + return ResourceManager.GetString("DeploymentAlreadyInState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment in {0} slot for service {1} is removed. + /// + public static string DeploymentRemovedMessage + { + get + { + return ResourceManager.GetString("DeploymentRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel. + /// + public static string DiagnosticLevelName + { + get + { + return ResourceManager.GetString("DiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string DiagnosticLevelValue + { + get + { + return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key to add already exists in the dictionary.. + /// + public static string DictionaryAddAlreadyContainsKey + { + get + { + return ResourceManager.GetString("DictionaryAddAlreadyContainsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The array index cannot be less than zero.. + /// + public static string DictionaryCopyToArrayIndexLessThanZero + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayIndexLessThanZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The supplied array does not have enough room to contain the copied elements.. + /// + public static string DictionaryCopyToArrayTooShort + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayTooShort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided dns {0} doesn't exist. + /// + public static string DnsDoesNotExist + { + get + { + return ResourceManager.GetString("DnsDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure Certificate. + /// + public static string EnableRemoteDesktop_FriendlyCertificateName + { + get + { + return ResourceManager.GetString("EnableRemoteDesktop_FriendlyCertificateName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Endpoint can't be retrieved for storage account. + /// + public static string EndPointNotFoundForBlobStorage + { + get + { + return ResourceManager.GetString("EndPointNotFoundForBlobStorage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} end processing.. + /// + public static string EndProcessingLog + { + get + { + return ResourceManager.GetString("EndProcessingLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet.. + /// + public static string EnvironmentDoesNotSupportActiveDirectory + { + get + { + return ResourceManager.GetString("EnvironmentDoesNotSupportActiveDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment '{0}' already exists.. + /// + public static string EnvironmentExists + { + get + { + return ResourceManager.GetString("EnvironmentExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name doesn't match one in subscription.. + /// + public static string EnvironmentNameDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name needs to be specified.. + /// + public static string EnvironmentNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment needs to be specified.. + /// + public static string EnvironmentNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment name '{0}' is not found.. + /// + public static string EnvironmentNotFound + { + get + { + return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to environments.xml. + /// + public static string EnvironmentsFileName + { + get + { + return ResourceManager.GetString("EnvironmentsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error creating VirtualMachine. + /// + public static string ErrorCreatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorCreatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to download available runtimes for location '{0}'. + /// + public static string ErrorRetrievingRuntimesForLocation + { + get + { + return ResourceManager.GetString("ErrorRetrievingRuntimesForLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error updating VirtualMachine. + /// + public static string ErrorUpdatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorUpdatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}. + /// + public static string FailedJobErrorMessage + { + get + { + return ResourceManager.GetString("FailedJobErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File path is not valid.. + /// + public static string FilePathIsNotValid + { + get + { + return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP request was forbidden with client authentication scheme 'Anonymous'.. + /// + public static string FirstPurchaseErrorMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell.. + /// + public static string FirstPurchaseMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Status:. + /// + public static string GatewayOperationStatus + { + get + { + return ResourceManager.GetString("GatewayOperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\General. + /// + public static string GeneralScaffolding + { + get + { + return ResourceManager.GetString("GeneralScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting all available Microsoft Azure Add-Ons, this may take few minutes.... + /// + public static string GetAllAddOnsWaitMessage + { + get + { + return ResourceManager.GetString("GetAllAddOnsWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name{0}Primary Key{0}Seconday Key. + /// + public static string GetStorageKeysHeader + { + get + { + return ResourceManager.GetString("GetStorageKeysHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Git not found. Please install git and place it in your command line path.. + /// + public static string GitNotFound + { + get + { + return ResourceManager.GetString("GitNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile.. + /// + public static string GlobalSettingsManager_Load_PublishSettingsNotFound + { + get + { + return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg end element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoEndWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoEndWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WadCfg start element in the config is not matching the end element.. + /// + public static string IaasDiagnosticsBadConfigNoMatchingWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoMatchingWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode.dll. + /// + public static string IISNodeDll + { + get + { + return ResourceManager.GetString("IISNodeDll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeEngineKey + { + get + { + return ResourceManager.GetString("IISNodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode-dev\\release\\x64. + /// + public static string IISNodePath + { + get + { + return ResourceManager.GetString("IISNodePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeRuntimeValue + { + get + { + return ResourceManager.GetString("IISNodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}). + /// + public static string IISNodeVersionWarningText + { + get + { + return ResourceManager.GetString("IISNodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal characters in path.. + /// + public static string IllegalPath + { + get + { + return ResourceManager.GetString("IllegalPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. + /// + public static string InternalServerErrorMessage + { + get + { + return ResourceManager.GetString("InternalServerErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot enable memcach protocol on a cache worker role {0}.. + /// + public static string InvalidCacheRoleName + { + get + { + return ResourceManager.GetString("InvalidCacheRoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. + /// + public static string InvalidCertificate + { + get + { + return ResourceManager.GetString("InvalidCertificate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format.. + /// + public static string InvalidCertificateSingle + { + get + { + return ResourceManager.GetString("InvalidCertificateSingle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided configuration path is invalid or doesn't exist. + /// + public static string InvalidConfigPath + { + get + { + return ResourceManager.GetString("InvalidConfigPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.. + /// + public static string InvalidCountryNameMessage + { + get + { + return ResourceManager.GetString("InvalidCountryNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. + /// + public static string InvalidDefaultSubscription + { + get + { + return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment with {0} does not exist. + /// + public static string InvalidDeployment + { + get + { + return ResourceManager.GetString("InvalidDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".. + /// + public static string InvalidDeploymentSlot + { + get + { + return ResourceManager.GetString("InvalidDeploymentSlot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. + /// + public static string InvalidDnsName + { + get + { + return ResourceManager.GetString("InvalidDnsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service endpoint.. + /// + public static string InvalidEndpoint + { + get + { + return ResourceManager.GetString("InvalidEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. + /// + public static string InvalidFileExtension + { + get + { + return ResourceManager.GetString("InvalidFileExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File {0} has invalid characters. + /// + public static string InvalidFileName + { + get + { + return ResourceManager.GetString("InvalidFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your git publishing credentials using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. On the left side open "Web Sites" + ///2. Click on any website + ///3. Choose "Setup Git Publishing" or "Reset deployment credentials" + ///4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username}. + /// + public static string InvalidGitCredentials + { + get + { + return ResourceManager.GetString("InvalidGitCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value {0} provided is not a valid GUID. Please provide a valid GUID.. + /// + public static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified hostname does not exist. Please specify a valid hostname for the site.. + /// + public static string InvalidHostnameValidation + { + get + { + return ResourceManager.GetString("InvalidHostnameValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances must be greater than or equal 0 and less than or equal 20. + /// + public static string InvalidInstancesCount + { + get + { + return ResourceManager.GetString("InvalidInstancesCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.. + /// + public static string InvalidJobFile + { + get + { + return ResourceManager.GetString("InvalidJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again.. + /// + public static string InvalidManifestError + { + get + { + return ResourceManager.GetString("InvalidManifestError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The account {0} was not found. Please specify a valid account name.. + /// + public static string InvalidMediaServicesAccount + { + get + { + return ResourceManager.GetString("InvalidMediaServicesAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided name "{0}" does not match the service bus namespace naming rules.. + /// + public static string InvalidNamespaceName + { + get + { + return ResourceManager.GetString("InvalidNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path must specify a valid path to an Azure profile.. + /// + public static string InvalidNewProfilePath + { + get + { + return ResourceManager.GetString("InvalidNewProfilePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null. Parameter name: '{0}'. + /// + public static string InvalidNullArgument + { + get + { + return ResourceManager.GetString("InvalidNullArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is invalid or empty. + /// + public static string InvalidOrEmptyArgumentMessage + { + get + { + return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided package path is invalid or doesn't exist. + /// + public static string InvalidPackagePath + { + get + { + return ResourceManager.GetString("InvalidPackagePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid parameter set name.. + /// + public static string InvalidParameterSetName + { + get + { + return ResourceManager.GetString("InvalidParameterSetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} doesn't exist in {1} or you've not passed valid value for it. + /// + public static string InvalidPath + { + get + { + return ResourceManager.GetString("InvalidPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} has invalid characters. + /// + public static string InvalidPathName + { + get + { + return ResourceManager.GetString("InvalidPathName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token}. + /// + public static string InvalidProfileProperties + { + get + { + return ResourceManager.GetString("InvalidProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile. + /// + public static string InvalidPublishSettingsSchema + { + get + { + return ResourceManager.GetString("InvalidPublishSettingsSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name "{0}" has invalid characters. + /// + public static string InvalidRoleNameMessage + { + get + { + return ResourceManager.GetString("InvalidRoleNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid name for the service root folder is required. + /// + public static string InvalidRootNameMessage + { + get + { + return ResourceManager.GetString("InvalidRootNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a recognized runtime type. + /// + public static string InvalidRuntimeError + { + get + { + return ResourceManager.GetString("InvalidRuntimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid language is required. + /// + public static string InvalidScaffoldingLanguageArg + { + get + { + return ResourceManager.GetString("InvalidScaffoldingLanguageArg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscription is currently selected. Use Select-Subscription to activate a subscription.. + /// + public static string InvalidSelectedSubscription + { + get + { + return ResourceManager.GetString("InvalidSelectedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations.. + /// + public static string InvalidServiceBusLocation + { + get + { + return ResourceManager.GetString("InvalidServiceBusLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide a service name or run this command from inside a service project directory.. + /// + public static string InvalidServiceName + { + get + { + return ResourceManager.GetString("InvalidServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must provide valid value for {0}. + /// + public static string InvalidServiceSettingElement + { + get + { + return ResourceManager.GetString("InvalidServiceSettingElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to settings.json is invalid or doesn't exist. + /// + public static string InvalidServiceSettingMessage + { + get + { + return ResourceManager.GetString("InvalidServiceSettingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.. + /// + public static string InvalidSubscription + { + get + { + return ResourceManager.GetString("InvalidSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscription id {0} is not valid. + /// + public static string InvalidSubscriptionId + { + get + { + return ResourceManager.GetString("InvalidSubscriptionId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Must specify a non-null subscription name.. + /// + public static string InvalidSubscriptionName + { + get + { + return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet. + /// + public static string InvalidSubscriptionNameMessage + { + get + { + return ResourceManager.GetString("InvalidSubscriptionNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscriptions file {0} has invalid content.. + /// + public static string InvalidSubscriptionsDataSchema + { + get + { + return ResourceManager.GetString("InvalidSubscriptionsDataSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.. + /// + public static string InvalidVMSize + { + get + { + return ResourceManager.GetString("InvalidVMSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web job file must have *.zip extension. + /// + public static string InvalidWebJobFile + { + get + { + return ResourceManager.GetString("InvalidWebJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Singleton option works for continuous jobs only.. + /// + public static string InvalidWebJobSingleton + { + get + { + return ResourceManager.GetString("InvalidWebJobSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The website {0} was not found. Please specify a valid website name.. + /// + public static string InvalidWebsite + { + get + { + return ResourceManager.GetString("InvalidWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No job for id: {0} was found.. + /// + public static string JobNotFound + { + get + { + return ResourceManager.GetString("JobNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to engines. + /// + public static string JsonEnginesSectionName + { + get + { + return ResourceManager.GetString("JsonEnginesSectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scaffolding for this language is not yet supported. + /// + public static string LanguageScaffoldingIsNotSupported + { + get + { + return ResourceManager.GetString("LanguageScaffoldingIsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link already established. + /// + public static string LinkAlreadyEstablished + { + get + { + return ResourceManager.GetString("LinkAlreadyEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to local_package.csx. + /// + public static string LocalPackageFileName + { + get + { + return ResourceManager.GetString("LocalPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Local.cscfg. + /// + public static string LocalServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("LocalServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for {0} deployment for {1} cloud service.... + /// + public static string LookingForDeploymentMessage + { + get + { + return ResourceManager.GetString("LookingForDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for cloud service {0}.... + /// + public static string LookingForServiceMessage + { + get + { + return ResourceManager.GetString("LookingForServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Long-Running Job. + /// + public static string LROJobName + { + get + { + return ResourceManager.GetString("LROJobName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter.. + /// + public static string LROTaskExceptionMessage + { + get + { + return ResourceManager.GetString("LROTaskExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to managementCertificate.pem. + /// + public static string ManagementCertificateFileName + { + get + { + return ResourceManager.GetString("ManagementCertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ?whr={0}. + /// + public static string ManagementPortalRealmFormat + { + get + { + return ResourceManager.GetString("ManagementPortalRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //baseuri. + /// + public static string ManifestBaseUriQuery + { + get + { + return ResourceManager.GetString("ManifestBaseUriQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uri. + /// + public static string ManifestBlobUriKey + { + get + { + return ResourceManager.GetString("ManifestBlobUriKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml. + /// + public static string ManifestUri + { + get + { + return ResourceManager.GetString("ManifestUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'.. + /// + public static string MissingCertificateInProfileProperties + { + get + { + return ResourceManager.GetString("MissingCertificateInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'.. + /// + public static string MissingPasswordInProfileProperties + { + get + { + return ResourceManager.GetString("MissingPasswordInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'SubscriptionId'.. + /// + public static string MissingSubscriptionInProfileProperties + { + get + { + return ResourceManager.GetString("MissingSubscriptionInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple Add-Ons found holding name {0}. + /// + public static string MultipleAddOnsFoundMessage + { + get + { + return ResourceManager.GetString("MultipleAddOnsFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername.. + /// + public static string MultiplePublishingUsernames + { + get + { + return ResourceManager.GetString("MultiplePublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The first publish settings file "{0}" is used. If you want to use another file specify the file name.. + /// + public static string MultiplePublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("MultiplePublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches. + /// + public static string NamedCacheSettingName + { + get + { + return ResourceManager.GetString("NamedCacheSettingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}. + /// + public static string NamedCacheSettingValue + { + get + { + return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A publishing username is required. Please specify one using the argument PublishingUsername.. + /// + public static string NeedPublishingUsernames + { + get + { + return ResourceManager.GetString("NeedPublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Add-On Confirmation. + /// + public static string NewAddOnConformation + { + get + { + return ResourceManager.GetString("NewAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string NewMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names.. + /// + public static string NewNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("NewNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at {0} and (c) agree to sharing my contact information with {2}.. + /// + public static string NewNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service has been created at {0}. + /// + public static string NewServiceCreatedMessage + { + get + { + return ResourceManager.GetString("NewServiceCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string No + { + get + { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription.. + /// + public static string NoCachedToken + { + get + { + return ResourceManager.GetString("NoCachedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole.. + /// + public static string NoCacheWorkerRoles + { + get + { + return ResourceManager.GetString("NoCacheWorkerRoles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No clouds available. + /// + public static string NoCloudsAvailable + { + get + { + return ResourceManager.GetString("NoCloudsAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "There is no current context, please log in using Connect-AzAccount.". + /// + public static string NoCurrentContextForDataCmdlet + { + get + { + return ResourceManager.GetString("NoCurrentContextForDataCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeDirectory + { + get + { + return ResourceManager.GetString("NodeDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeEngineKey + { + get + { + return ResourceManager.GetString("NodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node.exe. + /// + public static string NodeExe + { + get + { + return ResourceManager.GetString("NodeExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name>. + /// + public static string NoDefaultSubscriptionMessage + { + get + { + return ResourceManager.GetString("NoDefaultSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft SDKs\Azure\Nodejs\Nov2011. + /// + public static string NodeModulesPath + { + get + { + return ResourceManager.GetString("NodeModulesPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeProgramFilesFolderName + { + get + { + return ResourceManager.GetString("NodeProgramFilesFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeRuntimeValue + { + get + { + return ResourceManager.GetString("NodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\Node. + /// + public static string NodeScaffolding + { + get + { + return ResourceManager.GetString("NodeScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node. + /// + public static string NodeScaffoldingResources + { + get + { + return ResourceManager.GetString("NodeScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}). + /// + public static string NodeVersionWarningText + { + get + { + return ResourceManager.GetString("NodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No, I do not agree. + /// + public static string NoHint + { + get + { + return ResourceManager.GetString("NoHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. + /// + public static string NoInternetConnection + { + get + { + return ResourceManager.GetString("NoInternetConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <NONE>. + /// + public static string None + { + get + { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No publish settings files with extension *.publishsettings are found in the directory "{0}".. + /// + public static string NoPublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("NoPublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no subscription associated with account {0}.. + /// + public static string NoSubscriptionAddedMessage + { + get + { + return ResourceManager.GetString("NoSubscriptionAddedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount?. + /// + public static string NoSubscriptionFoundForTenant + { + get + { + return ResourceManager.GetString("NoSubscriptionFoundForTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.. + /// + public static string NotCacheWorkerRole + { + get + { + return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate can't be null.. + /// + public static string NullCertificateMessage + { + get + { + return ResourceManager.GetString("NullCertificateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} could not be null or empty. + /// + public static string NullObjectMessage + { + get + { + return ResourceManager.GetString("NullObjectMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add a null RoleSettings to {0}. + /// + public static string NullRoleSettingsMessage + { + get + { + return ResourceManager.GetString("NullRoleSettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add new role to null service definition. + /// + public static string NullServiceDefinitionMessage + { + get + { + return ResourceManager.GetString("NullServiceDefinitionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request offer '{0}' is not found.. + /// + public static string OfferNotFoundMessage + { + get + { + return ResourceManager.GetString("OfferNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation "{0}" failed on VM with ID: {1}. + /// + public static string OperationFailedErrorMessage + { + get + { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The REST operation failed with message '{0}' and error code '{1}'. + /// + public static string OperationFailedMessage + { + get + { + return ResourceManager.GetString("OperationFailedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state.. + /// + public static string OperationTimedOutOrError + { + get + { + return ResourceManager.GetString("OperationTimedOutOrError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package. + /// + public static string Package + { + get + { + return ResourceManager.GetString("Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Package is created at service root path {0}.. + /// + public static string PackageCreated + { + get + { + return ResourceManager.GetString("PackageCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {{ + /// "author": "", + /// + /// "name": "{0}", + /// "version": "0.0.0", + /// "dependencies":{{}}, + /// "devDependencies":{{}}, + /// "optionalDependencies": {{}}, + /// "engines": {{ + /// "node": "*", + /// "iisnode": "*" + /// }} + /// + ///}} + ///. + /// + public static string PackageJsonDefaultFile + { + get + { + return ResourceManager.GetString("PackageJsonDefaultFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package.json. + /// + public static string PackageJsonFileName + { + get + { + return ResourceManager.GetString("PackageJsonFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} doesn't exist.. + /// + public static string PathDoesNotExist + { + get + { + return ResourceManager.GetString("PathDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. + /// + public static string PathDoesNotExistForElement + { + get + { + return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Peer Asn has to be provided.. + /// + public static string PeerAsnRequired + { + get + { + return ResourceManager.GetString("PeerAsnRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 5.4.0. + /// + public static string PHPDefaultRuntimeVersion + { + get + { + return ResourceManager.GetString("PHPDefaultRuntimeVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to php. + /// + public static string PhpRuntimeValue + { + get + { + return ResourceManager.GetString("PhpRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\PHP. + /// + public static string PHPScaffolding + { + get + { + return ResourceManager.GetString("PHPScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP. + /// + public static string PHPScaffoldingResources + { + get + { + return ResourceManager.GetString("PHPScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}). + /// + public static string PHPVersionWarningText + { + get + { + return ResourceManager.GetString("PHPVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your first web site using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. At the bottom of the page, click on New > Web Site > Quick Create + ///2. Type {0} in the URL field + ///3. Click on "Create Web Site" + ///4. Once the site has been created, click on the site name + ///5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create.. + /// + public static string PortalInstructions + { + get + { + return ResourceManager.GetString("PortalInstructions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git". + /// + public static string PortalInstructionsGit + { + get + { + return ResourceManager.GetString("PortalInstructionsGit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// + public static string PreviewCmdletMessage + { + get + { + return ResourceManager.GetString("PreviewCmdletMessage", resourceCulture); + } + } + + + /// + /// Looks up a localized string similar to A value for the Primary Peer Subnet has to be provided.. + /// + public static string PrimaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("PrimaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Promotion code can be used only when updating to a new plan.. + /// + public static string PromotionCodeWithCurrentPlanMessage + { + get + { + return ResourceManager.GetString("PromotionCodeWithCurrentPlanMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service not published at user request.. + /// + public static string PublishAbortedAtUserRequest + { + get + { + return ResourceManager.GetString("PublishAbortedAtUserRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete.. + /// + public static string PublishCompleteMessage + { + get + { + return ResourceManager.GetString("PublishCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string PublishConnectingMessage + { + get + { + return ResourceManager.GetString("PublishConnectingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Deployment ID: {0}.. + /// + public static string PublishCreatedDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishCreatedDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created hosted service '{0}'.. + /// + public static string PublishCreatedServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatedServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Website URL: {0}.. + /// + public static string PublishCreatedWebsiteMessage + { + get + { + return ResourceManager.GetString("PublishCreatedWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating.... + /// + public static string PublishCreatingServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatingServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing.... + /// + public static string PublishInitializingMessage + { + get + { + return ResourceManager.GetString("PublishInitializingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to busy. + /// + public static string PublishInstanceStatusBusy + { + get + { + return ResourceManager.GetString("PublishInstanceStatusBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to creating the virtual machine. + /// + public static string PublishInstanceStatusCreating + { + get + { + return ResourceManager.GetString("PublishInstanceStatusCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance {0} of role {1} is {2}.. + /// + public static string PublishInstanceStatusMessage + { + get + { + return ResourceManager.GetString("PublishInstanceStatusMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ready. + /// + public static string PublishInstanceStatusReady + { + get + { + return ResourceManager.GetString("PublishInstanceStatusReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing deployment for {0} with Subscription ID: {1}.... + /// + public static string PublishPreparingDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishPreparingDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publishing {0} to Microsoft Azure. This may take several minutes.... + /// + public static string PublishServiceStartMessage + { + get + { + return ResourceManager.GetString("PublishServiceStartMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publish settings. + /// + public static string PublishSettings + { + get + { + return ResourceManager.GetString("PublishSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure. + /// + public static string PublishSettingsElementName + { + get + { + return ResourceManager.GetString("PublishSettingsElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to .PublishSettings. + /// + public static string PublishSettingsFileExtention + { + get + { + return ResourceManager.GetString("PublishSettingsFileExtention", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publishSettings.xml. + /// + public static string PublishSettingsFileName + { + get + { + return ResourceManager.GetString("PublishSettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &whr={0}. + /// + public static string PublishSettingsFileRealmFormat + { + get + { + return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publish settings imported. + /// + public static string PublishSettingsSetSuccessfully + { + get + { + return ResourceManager.GetString("PublishSettingsSetSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PUBLISHINGPROFILE_URL. + /// + public static string PublishSettingsUrlEnv + { + get + { + return ResourceManager.GetString("PublishSettingsUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting.... + /// + public static string PublishStartingMessage + { + get + { + return ResourceManager.GetString("PublishStartingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upgrading.... + /// + public static string PublishUpgradingMessage + { + get + { + return ResourceManager.GetString("PublishUpgradingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uploading Package to storage service {0}.... + /// + public static string PublishUploadingPackageMessage + { + get + { + return ResourceManager.GetString("PublishUploadingPackageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verifying storage account '{0}'.... + /// + public static string PublishVerifyingStorageMessage + { + get + { + return ResourceManager.GetString("PublishVerifyingStorageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionAdditionalContentPathNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionAdditionalContentPathNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration published to {0}. + /// + public static string PublishVMDscExtensionArchiveUploadedMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionArchiveUploadedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyFileVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyFileVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the module '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyModuleVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyModuleVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1).. + /// + public static string PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted '{0}'. + /// + public static string PublishVMDscExtensionDeletedFileMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeletedFileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot delete '{0}': {1}. + /// + public static string PublishVMDscExtensionDeleteErrorMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeleteErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionDirectoryNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDirectoryNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get module for DscResource '{0}'. Possible solutions: + ///1) Specify -ModuleName for Import-DscResource in your configuration. + ///2) Unblock module that contains resource. + ///3) Move Import-DscResource inside Node block. + ///. + /// + public static string PublishVMDscExtensionGetDscResourceFailed + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionGetDscResourceFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of required modules: [{0}].. + /// + public static string PublishVMDscExtensionRequiredModulesVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredModulesVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version.. + /// + public static string PublishVMDscExtensionRequiredPsVersion + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredPsVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration script '{0}' contained parse errors: + ///{1}. + /// + public static string PublishVMDscExtensionStorageParserErrors + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionStorageParserErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp folder '{0}' created.. + /// + public static string PublishVMDscExtensionTempFolderVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionTempFolderVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip).. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration file '{0}' not found.. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. + ///Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enab [rest of string was truncated]";. + /// + public static string RDFEDataCollectionMessage + { + get + { + return ResourceManager.GetString("RDFEDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace current deployment with '{0}' Id ?. + /// + public static string RedeployCommit + { + get + { + return ResourceManager.GetString("RedeployCommit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to regenerate key?. + /// + public static string RegenerateKeyWarning + { + get + { + return ResourceManager.GetString("RegenerateKeyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate new key.. + /// + public static string RegenerateKeyWhatIfMessage + { + get + { + return ResourceManager.GetString("RegenerateKeyWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove account '{0}'?. + /// + public static string RemoveAccountConfirmation + { + get + { + return ResourceManager.GetString("RemoveAccountConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing account. + /// + public static string RemoveAccountMessage + { + get + { + return ResourceManager.GetString("RemoveAccountMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Add-On Confirmation. + /// + public static string RemoveAddOnConformation + { + get + { + return ResourceManager.GetString("RemoveAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm.. + /// + public static string RemoveAddOnMessage + { + get + { + return ResourceManager.GetString("RemoveAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureBGPPeering Operation failed.. + /// + public static string RemoveAzureBGPPeeringFailed + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Bgp Peering. + /// + public static string RemoveAzureBGPPeeringMessage + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Bgp Peering with Service Key {0}.. + /// + public static string RemoveAzureBGPPeeringSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Bgp Peering with service key '{0}'?. + /// + public static string RemoveAzureBGPPeeringWarning + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit with service key '{0}'?. + /// + public static string RemoveAzureDedicatdCircuitWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatdCircuitWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuit Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuitLink Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitLinkFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circui Link. + /// + public static string RemoveAzureDedicatedCircuitLinkMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1}. + /// + public static string RemoveAzureDedicatedCircuitLinkSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'?. + /// + public static string RemoveAzureDedicatedCircuitLinkWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circuit. + /// + public static string RemoveAzureDedicatedCircuitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit with Service Key {0}.. + /// + public static string RemoveAzureDedicatedCircuitSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing cloud service {0}.... + /// + public static string RemoveAzureServiceWaitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureServiceWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.. + /// + public static string RemoveDefaultSubscription + { + get + { + return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing {0} deployment for {1} service. + /// + public static string RemoveDeploymentWaitMessage + { + get + { + return ResourceManager.GetString("RemoveDeploymentWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'?. + /// + public static string RemoveEnvironmentConfirmation + { + get + { + return ResourceManager.GetString("RemoveEnvironmentConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing environment. + /// + public static string RemoveEnvironmentMessage + { + get + { + return ResourceManager.GetString("RemoveEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job collection. + /// + public static string RemoveJobCollectionMessage + { + get + { + return ResourceManager.GetString("RemoveJobCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job collection "{0}". + /// + public static string RemoveJobCollectionWarning + { + get + { + return ResourceManager.GetString("RemoveJobCollectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job. + /// + public static string RemoveJobMessage + { + get + { + return ResourceManager.GetString("RemoveJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job "{0}". + /// + public static string RemoveJobWarning + { + get + { + return ResourceManager.GetString("RemoveJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the account?. + /// + public static string RemoveMediaAccountWarning + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account removed.. + /// + public static string RemoveMediaAccountWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription.. + /// + public static string RemoveNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("RemoveNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing old package {0}.... + /// + public static string RemovePackage + { + get + { + return ResourceManager.GetString("RemovePackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?. + /// + public static string RemoveProfileConfirmation + { + get + { + return ResourceManager.GetString("RemoveProfileConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile. + /// + public static string RemoveProfileMessage + { + get + { + return ResourceManager.GetString("RemoveProfileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the namespace '{0}'?. + /// + public static string RemoveServiceBusNamespaceConfirmation + { + get + { + return ResourceManager.GetString("RemoveServiceBusNamespaceConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove cloud service?. + /// + public static string RemoveServiceWarning + { + get + { + return ResourceManager.GetString("RemoveServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove cloud service and all it's deployments. + /// + public static string RemoveServiceWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveServiceWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription '{0}'?. + /// + public static string RemoveSubscriptionConfirmation + { + get + { + return ResourceManager.GetString("RemoveSubscriptionConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription. + /// + public static string RemoveSubscriptionMessage + { + get + { + return ResourceManager.GetString("RemoveSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The endpoint {0} cannot be removed from profile {1} because it's not in the profile.. + /// + public static string RemoveTrafficManagerEndpointMissing + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerEndpointMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureTrafficManagerProfile Operation failed.. + /// + public static string RemoveTrafficManagerProfileFailed + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Traffic Manager profile with name {0}.. + /// + public static string RemoveTrafficManagerProfileSucceeded + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Traffic Manager profile "{0}"?. + /// + public static string RemoveTrafficManagerProfileWarning + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the VM '{0}'?. + /// + public static string RemoveVMConfirmationMessage + { + get + { + return ResourceManager.GetString("RemoveVMConfirmationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting VM.. + /// + public static string RemoveVMMessage + { + get + { + return ResourceManager.GetString("RemoveVMMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing WebJob.... + /// + public static string RemoveWebJobMessage + { + get + { + return ResourceManager.GetString("RemoveWebJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove job '{0}'?. + /// + public static string RemoveWebJobWarning + { + get + { + return ResourceManager.GetString("RemoveWebJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing website. + /// + public static string RemoveWebsiteMessage + { + get + { + return ResourceManager.GetString("RemoveWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the website "{0}". + /// + public static string RemoveWebsiteWarning + { + get + { + return ResourceManager.GetString("RemoveWebsiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing public environment is not supported.. + /// + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { + return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting namespace. + /// + public static string RemovingNamespaceMessage + { + get + { + return ResourceManager.GetString("RemovingNamespaceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository is not setup. You need to pass a valid site name.. + /// + public static string RepositoryNotSetup + { + get + { + return ResourceManager.GetString("RepositoryNotSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use.. + /// + public static string ReservedIPNameNoLongerInUseButStillBeingReserved + { + get + { + return ResourceManager.GetString("ReservedIPNameNoLongerInUseButStillBeingReserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource with ID : {0} does not exist.. + /// + public static string ResourceNotFound + { + get + { + return ResourceManager.GetString("ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restart. + /// + public static string Restart + { + get + { + return ResourceManager.GetString("Restart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resume. + /// + public static string Resume + { + get + { + return ResourceManager.GetString("Resume", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /role:{0};"{1}/{0}" . + /// + public static string RoleArgTemplate + { + get + { + return ResourceManager.GetString("RoleArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to bin. + /// + public static string RoleBinFolderName + { + get + { + return ResourceManager.GetString("RoleBinFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} is {1}. + /// + public static string RoleInstanceWaitMsg + { + get + { + return ResourceManager.GetString("RoleInstanceWaitMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 20. + /// + public static string RoleMaxInstances + { + get + { + return ResourceManager.GetString("RoleMaxInstances", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to role name. + /// + public static string RoleName + { + get + { + return ResourceManager.GetString("RoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name {0} doesn't exist. + /// + public static string RoleNotFoundMessage + { + get + { + return ResourceManager.GetString("RoleNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RoleSettings.xml. + /// + public static string RoleSettingsTemplateFileName + { + get + { + return ResourceManager.GetString("RoleSettingsTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role type {0} doesn't exist. + /// + public static string RoleTypeDoesNotExist + { + get + { + return ResourceManager.GetString("RoleTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to public static Dictionary<string, Location> ReverseLocations { get; private set; }. + /// + public static string RuntimeDeploymentLocationError + { + get + { + return ResourceManager.GetString("RuntimeDeploymentLocationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing runtime deployment for service '{0}'. + /// + public static string RuntimeDeploymentStart + { + get + { + return ResourceManager.GetString("RuntimeDeploymentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version?. + /// + public static string RuntimeMismatchWarning + { + get + { + return ResourceManager.GetString("RuntimeMismatchWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEOVERRIDEURL. + /// + public static string RuntimeOverrideKey + { + get + { + return ResourceManager.GetString("RuntimeOverrideKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /runtimemanifest/runtimes/runtime. + /// + public static string RuntimeQuery + { + get + { + return ResourceManager.GetString("RuntimeQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEID. + /// + public static string RuntimeTypeKey + { + get + { + return ResourceManager.GetString("RuntimeTypeKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEURL. + /// + public static string RuntimeUrlKey + { + get + { + return ResourceManager.GetString("RuntimeUrlKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEVERSIONPRIMARYKEY. + /// + public static string RuntimeVersionPrimaryKey + { + get + { + return ResourceManager.GetString("RuntimeVersionPrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to scaffold.xml. + /// + public static string ScaffoldXml + { + get + { + return ResourceManager.GetString("ScaffoldXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation. + /// + public static string SchedulerInvalidLocation + { + get + { + return ResourceManager.GetString("SchedulerInvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Secondary Peer Subnet has to be provided.. + /// + public static string SecondaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("SecondaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} already exists on disk in location {1}. + /// + public static string ServiceAlreadyExistsOnDisk + { + get + { + return ResourceManager.GetString("ServiceAlreadyExistsOnDisk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ServiceBus authorization rule with the given characteristics was found. + /// + public static string ServiceBusAuthorizationRuleNotFound + { + get + { + return ResourceManager.GetString("ServiceBusAuthorizationRuleNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service bus entity '{0}' is not found.. + /// + public static string ServiceBusEntityTypeNotFound + { + get + { + return ResourceManager.GetString("ServiceBusEntityTypeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen due to an incorrect/missing namespace. + /// + public static string ServiceBusNamespaceMissingMessage + { + get + { + return ResourceManager.GetString("ServiceBusNamespaceMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service configuration. + /// + public static string ServiceConfiguration + { + get + { + return ResourceManager.GetString("ServiceConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service definition. + /// + public static string ServiceDefinition + { + get + { + return ResourceManager.GetString("ServiceDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceDefinition.csdef. + /// + public static string ServiceDefinitionFileName + { + get + { + return ResourceManager.GetString("ServiceDefinitionFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}Deploy. + /// + public static string ServiceDeploymentName + { + get + { + return ResourceManager.GetString("ServiceDeploymentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified cloud service "{0}" does not exist.. + /// + public static string ServiceDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is in {2} state, please wait until it finish and update it's status. + /// + public static string ServiceIsInTransitionState + { + get + { + return ResourceManager.GetString("ServiceIsInTransitionState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.". + /// + public static string ServiceManagementClientExceptionStringFormat + { + get + { + return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service name. + /// + public static string ServiceName + { + get + { + return ResourceManager.GetString("ServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. + /// + public static string ServiceNameExists + { + get + { + return ResourceManager.GetString("ServiceNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide name for the hosted service. + /// + public static string ServiceNameMissingMessage + { + get + { + return ResourceManager.GetString("ServiceNameMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service parent directory. + /// + public static string ServiceParentDirectory + { + get + { + return ResourceManager.GetString("ServiceParentDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} removed successfully. + /// + public static string ServiceRemovedMessage + { + get + { + return ResourceManager.GetString("ServiceRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service directory. + /// + public static string ServiceRoot + { + get + { + return ResourceManager.GetString("ServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service settings. + /// + public static string ServiceSettings + { + get + { + return ResourceManager.GetString("ServiceSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.. + /// + public static string ServiceSettings_ValidateStorageAccountName_InvalidName + { + get + { + return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist.. + /// + public static string ServiceSlotDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceSlotDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is {2}. + /// + public static string ServiceStatusChanged + { + get + { + return ResourceManager.GetString("ServiceStatusChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Add-On Confirmation. + /// + public static string SetAddOnConformation + { + get + { + return ResourceManager.GetString("SetAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} does not contain endpoint {1}. Adding it.. + /// + public static string SetInexistentTrafficManagerEndpointMessage + { + get + { + return ResourceManager.GetString("SetInexistentTrafficManagerEndpointMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string SetMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at <url> and (c) agree to sharing my contact information with {2}.. + /// + public static string SetNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances are set to {1}. + /// + public static string SetRoleInstancesMessage + { + get + { + return ResourceManager.GetString("SetRoleInstancesMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"Slot":"","Location":"","Subscription":"","StorageAccountName":""}. + /// + public static string SettingsFileEmptyContent + { + get + { + return ResourceManager.GetString("SettingsFileEmptyContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to deploymentSettings.json. + /// + public static string SettingsFileName + { + get + { + return ResourceManager.GetString("SettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint.. + /// + public static string SetTrafficManagerEndpointNeedsParameters + { + get + { + return ResourceManager.GetString("SetTrafficManagerEndpointNeedsParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ambiguous operation: the profile name specified doesn't match the name of the profile object.. + /// + public static string SetTrafficManagerProfileAmbiguous + { + get + { + return ResourceManager.GetString("SetTrafficManagerProfileAmbiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts.. + /// + public static string ShouldContinueFail + { + get + { + return ResourceManager.GetString("ShouldContinueFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + public static string ShouldProcessCaption + { + get + { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailConfirm + { + get + { + return ResourceManager.GetString("ShouldProcessFailConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again.. + /// + public static string ShouldProcessFailImpact + { + get + { + return ResourceManager.GetString("ShouldProcessFailImpact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailWhatIf + { + get + { + return ResourceManager.GetString("ShouldProcessFailWhatIf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown + { + get + { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /sites:{0};{1};"{2}/{0}" . + /// + public static string SitesArgTemplate + { + get + { + return ResourceManager.GetString("SitesArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string StandardRetryDelayInMs + { + get + { + return ResourceManager.GetString("StandardRetryDelayInMs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + public static string Start + { + get + { + return ResourceManager.GetString("Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Started. + /// + public static string StartedEmulator + { + get + { + return ResourceManager.GetString("StartedEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Emulator.... + /// + public static string StartingEmulator + { + get + { + return ResourceManager.GetString("StartingEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to start. + /// + public static string StartStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StartStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string Stop + { + get + { + return ResourceManager.GetString("Stop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping emulator.... + /// + public static string StopEmulatorMessage + { + get + { + return ResourceManager.GetString("StopEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopped. + /// + public static string StoppedEmulatorMessage + { + get + { + return ResourceManager.GetString("StoppedEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to stop. + /// + public static string StopStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StopStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name:. + /// + public static string StorageAccountName + { + get + { + return ResourceManager.GetString("StorageAccountName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find storage account '{0}' please type the name of an existing storage account.. + /// + public static string StorageAccountNotFound + { + get + { + return ResourceManager.GetString("StorageAccountNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureStorageEmulator.exe. + /// + public static string StorageEmulatorExe + { + get + { + return ResourceManager.GetString("StorageEmulatorExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstallPath. + /// + public static string StorageEmulatorInstallPathRegistryKeyValue + { + get + { + return ResourceManager.GetString("StorageEmulatorInstallPathRegistryKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SOFTWARE\Microsoft\Windows Azure Storage Emulator. + /// + public static string StorageEmulatorRegistryKey + { + get + { + return ResourceManager.GetString("StorageEmulatorRegistryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key:. + /// + public static string StoragePrimaryKey + { + get + { + return ResourceManager.GetString("StoragePrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secondary Key:. + /// + public static string StorageSecondaryKey + { + get + { + return ResourceManager.GetString("StorageSecondaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} already exists.. + /// + public static string SubscriptionAlreadyExists + { + get + { + return ResourceManager.GetString("SubscriptionAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated + { + get + { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DefaultSubscriptionData.xml. + /// + public static string SubscriptionDataFileName + { + get + { + return ResourceManager.GetString("SubscriptionDataFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription data file {0} does not exist.. + /// + public static string SubscriptionDataFileNotFound + { + get + { + return ResourceManager.GetString("SubscriptionDataFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription id {0} doesn't exist.. + /// + public static string SubscriptionIdNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription must not be null. + /// + public static string SubscriptionMustNotBeNull + { + get + { + return ResourceManager.GetString("SubscriptionMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription name needs to be specified.. + /// + public static string SubscriptionNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription name {0} doesn't exist.. + /// + public static string SubscriptionNameNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription needs to be specified.. + /// + public static string SubscriptionNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suspend. + /// + public static string Suspend + { + get + { + return ResourceManager.GetString("Suspend", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swapping website production slot .... + /// + public static string SwappingWebsite + { + get + { + return ResourceManager.GetString("SwappingWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to swap the website '{0}' production slot with slot '{1}'?. + /// + public static string SwapWebsiteSlotWarning + { + get + { + return ResourceManager.GetString("SwapWebsiteSlotWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated + { + get + { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}'. + /// + public static string TraceBeginLROJob + { + get + { + return ResourceManager.GetString("TraceBeginLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}'. + /// + public static string TraceBlockLROThread + { + get + { + return ResourceManager.GetString("TraceBlockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Completing cmdlet execution in RunJob. + /// + public static string TraceEndLROJob + { + get + { + return ResourceManager.GetString("TraceEndLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}'. + /// + public static string TraceHandleLROStateChange + { + get + { + return ResourceManager.GetString("TraceHandleLROStateChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job due to stoppage or failure. + /// + public static string TraceHandlerCancelJob + { + get + { + return ResourceManager.GetString("TraceHandlerCancelJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job that was previously blocked.. + /// + public static string TraceHandlerUnblockJob + { + get + { + return ResourceManager.GetString("TraceHandlerUnblockJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Error in cmdlet execution. + /// + public static string TraceLROJobException + { + get + { + return ResourceManager.GetString("TraceLROJobException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Removing state changed event handler, exception '{0}'. + /// + public static string TraceRemoveLROEventHandler + { + get + { + return ResourceManager.GetString("TraceRemoveLROEventHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: ShouldMethod '{0}' unblocked.. + /// + public static string TraceUnblockLROThread + { + get + { + return ResourceManager.GetString("TraceUnblockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. + /// + public static string UnableToDecodeBase64String + { + get + { + return ResourceManager.GetString("UnableToDecodeBase64String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. + /// + public static string UnableToPatchJson + { + get + { + return ResourceManager.GetString("UnableToPatchJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provider {0} is unknown.. + /// + public static string UnknownProviderMessage + { + get + { + return ResourceManager.GetString("UnknownProviderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update + { + get + { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated settings for subscription '{0}'. Current subscription is '{1}'.. + /// + public static string UpdatedSettings + { + get + { + return ResourceManager.GetString("UpdatedSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name is not valid.. + /// + public static string UserNameIsNotValid + { + get + { + return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name needs to be specified.. + /// + public static string UserNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the VLan Id has to be provided.. + /// + public static string VlanIdRequired + { + get + { + return ResourceManager.GetString("VlanIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait.... + /// + public static string WaitMessage + { + get + { + return ResourceManager.GetString("WaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The azure storage emulator is not installed, skip launching.... + /// + public static string WarningWhenStorageEmulatorIsMissing + { + get + { + return ResourceManager.GetString("WarningWhenStorageEmulatorIsMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web.cloud.config. + /// + public static string WebCloudConfig + { + get + { + return ResourceManager.GetString("WebCloudConfig", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to web.config. + /// + public static string WebConfigTemplateFileName + { + get + { + return ResourceManager.GetString("WebConfigTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MSDeploy. + /// + public static string WebDeployKeywordInWebSitePublishProfile + { + get + { + return ResourceManager.GetString("WebDeployKeywordInWebSitePublishProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot build the project successfully. Please see logs in {0}.. + /// + public static string WebProjectBuildFailTemplate + { + get + { + return ResourceManager.GetString("WebProjectBuildFailTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole. + /// + public static string WebRole + { + get + { + return ResourceManager.GetString("WebRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_web.cmd > log.txt. + /// + public static string WebRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WebRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole.xml. + /// + public static string WebRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WebRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Webspace.. + /// + public static string WebsiteAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Location.. + /// + public static string WebsiteAlreadyExistsReplacement + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExistsReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site {0} already has repository created for it.. + /// + public static string WebsiteRepositoryAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteRepositoryAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workspaces/WebsiteExtension/Website/{0}/dashboard/. + /// + public static string WebsiteSufixUrl + { + get + { + return ResourceManager.GetString("WebsiteSufixUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}/msdeploy.axd?site={1}. + /// + public static string WebSiteWebDeployUriTemplate + { + get + { + return ResourceManager.GetString("WebSiteWebDeployUriTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole. + /// + public static string WorkerRole + { + get + { + return ResourceManager.GetString("WorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_worker.cmd > log.txt. + /// + public static string WorkerRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WorkerRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole.xml. + /// + public static string WorkerRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WorkerRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (x86). + /// + public static string x86InProgramFiles + { + get + { + return ResourceManager.GetString("x86InProgramFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Yes + { + get + { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, I agree. + /// + public static string YesHint + { + get + { + return ResourceManager.GetString("YesHint", resourceCulture); + } + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/Properties/Resources.resx b/swaggerci/datamigration/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..598cd53e958a --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The remote server returned an error: (401) Unauthorized. + + + Account "{0}" has been added. + + + To switch to a different subscription, please use Select-AzureSubscription. + + + Subscription "{0}" is selected as the default subscription. + + + To view all the subscriptions, please use Get-AzureSubscription. + + + Add-On {0} is created successfully. + + + Add-on name {0} is already used. + + + Add-On {0} not found. + + + Add-on {0} is removed successfully. + + + Add-On {0} is updated successfully. + + + Role has been created at {0}\{1}. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure". + + + Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator + + + A role name '{0}' already exists + + + Windows Azure Powershell\ + + + https://manage.windowsazure.com + + + AZURE_PORTAL_URL + + + Azure SDK\{0}\ + + + Base Uri was empty. + WAPackIaaS + + + {0} begin processing without ParameterSet. + + + {0} begin processing with ParameterSet '{1}'. + + + Blob with the name {0} already exists in the account. + + + https://{0}.blob.core.windows.net/ + + + AZURE_BLOBSTORAGE_TEMPLATE + + + CACHERUNTIMEURL + + + cache + + + CacheRuntimeVersion + + + Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}) + + + Cannot find {0} with name {1}. + + + Deployment for service {0} with {1} slot doesn't exist + + + Can't find valid Microsoft Azure role in current directory {0} + + + service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist + + + Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders. + + + The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated. + + + ManagementCertificate + + + certificate.pfx + + + Certificate imported into CurrentUser\My\{0} + + + Your account does not have access to the private key for certificate {0} + + + {0} {1} deployment for {2} service + + + Cloud service {0} is in {1} state. + + + Changing/Removing public environment '{0}' is not allowed. + + + Service {0} is set to value {1} + + + Choose which publish settings file to use: + + + Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel + + + 1 + + + cloud_package.cspkg + + + ServiceConfiguration.Cloud.cscfg + + + Add-ons for {0} + + + Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. + + + Complete + + + config.json + + + VirtualMachine creation failed. + WAPackIaaS + + + Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead. + + + Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core + + + //blobcontainer[@datacenter='{0}'] + + + Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription + + + none + + + There are no hostnames which could be used for validation. + + + 8080 + + + 1000 + + + Auto + + + 80 + + + Delete + WAPackIaaS + + + The {0} slot for service {1} is already in {2} state + + + The deployment in {0} slot for service {1} is removed + + + Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel + + + 1 + + + The key to add already exists in the dictionary. + + + The array index cannot be less than zero. + + + The supplied array does not have enough room to contain the copied elements. + + + The provided dns {0} doesn't exist + + + Microsoft Azure Certificate + + + Endpoint can't be retrieved for storage account + + + {0} end processing. + + + To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet. + + + The environment '{0}' already exists. + + + environments.xml + + + Error creating VirtualMachine + WAPackIaaS + + + Unable to download available runtimes for location '{0}' + + + Error updating VirtualMachine + WAPackIaaS + + + Job Id {0} failed. Error: {1}, ExceptionDetails: {2} + WAPackIaaS + + + The HTTP request was forbidden with client authentication scheme 'Anonymous'. + + + This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell. + + + Operation Status: + + + Resources\Scaffolding\General + + + Getting all available Microsoft Azure Add-Ons, this may take few minutes... + + + Name{0}Primary Key{0}Seconday Key + + + Git not found. Please install git and place it in your command line path. + + + Could not find publish settings. Please run Import-AzurePublishSettingsFile. + + + iisnode.dll + + + iisnode + + + iisnode-dev\\release\\x64 + + + iisnode + + + Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}) + + + Internal Server Error + + + Cannot enable memcach protocol on a cache worker role {0}. + + + Invalid certificate format. + + + The provided configuration path is invalid or doesn't exist + + + The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2. + + + Deployment with {0} does not exist + + + The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production". + + + Invalid service endpoint. + + + File {0} has invalid characters + + + You must create your git publishing credentials using the Microsoft Azure portal. +Please follow these steps in the portal: +1. On the left side open "Web Sites" +2. Click on any website +3. Choose "Setup Git Publishing" or "Reset deployment credentials" +4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username} + + + The value {0} provided is not a valid GUID. Please provide a valid GUID. + + + The specified hostname does not exist. Please specify a valid hostname for the site. + + + Role {0} instances must be greater than or equal 0 and less than or equal 20 + + + There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file. + + + Could not download a valid runtime manifest, Please check your internet connection and try again. + + + The account {0} was not found. Please specify a valid account name. + + + The provided name "{0}" does not match the service bus namespace naming rules. + + + Value cannot be null. Parameter name: '{0}' + + + The provided package path is invalid or doesn't exist + + + '{0}' is an invalid parameter set name. + + + {0} doesn't exist in {1} or you've not passed valid value for it + + + Path {0} has invalid characters + + + The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile + + + The provided role name "{0}" has invalid characters + + + A valid name for the service root folder is required + + + {0} is not a recognized runtime type + + + A valid language is required + + + No subscription is currently selected. Use Select-Subscription to activate a subscription. + + + The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations. + + + Please provide a service name or run this command from inside a service project directory. + + + You must provide valid value for {0} + + + settings.json is invalid or doesn't exist + + + The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data. + + + The provided subscription id {0} is not valid + + + A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet + + + The provided subscriptions file {0} has invalid content. + + + Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge. + + + The web job file must have *.zip extension + + + Singleton option works for continuous jobs only. + + + The website {0} was not found. Please specify a valid website name. + + + No job for id: {0} was found. + WAPackIaaS + + + engines + + + Scaffolding for this language is not yet supported + + + Link already established + + + local_package.csx + + + ServiceConfiguration.Local.cscfg + + + Looking for {0} deployment for {1} cloud service... + + + Looking for cloud service {0}... + + + managementCertificate.pem + + + ?whr={0} + + + //baseuri + + + uri + + + http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml + + + Multiple Add-Ons found holding name {0} + + + Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername. + + + The first publish settings file "{0}" is used. If you want to use another file specify the file name. + + + Microsoft.WindowsAzure.Plugins.Caching.NamedCaches + + + {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]} + + + A publishing username is required. Please specify one using the argument PublishingUsername. + + + New Add-On Confirmation + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names. + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at {0} and (c) agree to sharing my contact information with {2}. + + + Service has been created at {0} + + + No + + + There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription. + + + The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole. + + + No clouds available + WAPackIaaS + + + nodejs + + + node + + + node.exe + + + There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name> + + + Microsoft SDKs\Azure\Nodejs\Nov2011 + + + nodejs + + + node + + + Resources\Scaffolding\Node + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node + + + Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}) + + + No, I do not agree + + + No publish settings files with extension *.publishsettings are found in the directory "{0}". + + + '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration. + + + Certificate can't be null. + + + {0} could not be null or empty + + + Unable to add a null RoleSettings to {0} + + + Unable to add new role to null service definition + + + The request offer '{0}' is not found. + + + Operation "{0}" failed on VM with ID: {1} + WAPackIaaS + + + The REST operation failed with message '{0}' and error code '{1}' + + + Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state. + WAPackIaaS + + + package + + + Package is created at service root path {0}. + + + {{ + "author": "", + + "name": "{0}", + "version": "0.0.0", + "dependencies":{{}}, + "devDependencies":{{}}, + "optionalDependencies": {{}}, + "engines": {{ + "node": "*", + "iisnode": "*" + }} + +}} + + + + package.json + + + A value for the Peer Asn has to be provided. + + + 5.4.0 + + + php + + + Resources\Scaffolding\PHP + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP + + + Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}) + + + You must create your first web site using the Microsoft Azure portal. +Please follow these steps in the portal: +1. At the bottom of the page, click on New > Web Site > Quick Create +2. Type {0} in the URL field +3. Click on "Create Web Site" +4. Once the site has been created, click on the site name +5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create. + + + 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git" + + + A value for the Primary Peer Subnet has to be provided. + + + Promotion code can be used only when updating to a new plan. + + + Service not published at user request. + + + Complete. + + + Connecting... + + + Created Deployment ID: {0}. + + + Created hosted service '{0}'. + + + Created Website URL: {0}. + + + Creating... + + + Initializing... + + + busy + + + creating the virtual machine + + + Instance {0} of role {1} is {2}. + + + ready + + + Preparing deployment for {0} with Subscription ID: {1}... + + + Publishing {0} to Microsoft Azure. This may take several minutes... + + + publish settings + + + Azure + + + .PublishSettings + + + publishSettings.xml + + + Publish settings imported + + + AZURE_PUBLISHINGPROFILE_URL + + + Starting... + + + Upgrading... + + + Uploading Package to storage service {0}... + + + Verifying storage account '{0}'... + + + Replace current deployment with '{0}' Id ? + + + Are you sure you want to regenerate key? + + + Generate new key. + + + Are you sure you want to remove account '{0}'? + + + Removing account + + + Remove Add-On Confirmation + + + If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm. + + + Remove-AzureBGPPeering Operation failed. + + + Removing Bgp Peering + + + Successfully removed Azure Bgp Peering with Service Key {0}. + + + Are you sure you want to remove the Bgp Peering with service key '{0}'? + + + Are you sure you want to remove the Dedicated Circuit with service key '{0}'? + + + Remove-AzureDedicatedCircuit Operation failed. + + + Remove-AzureDedicatedCircuitLink Operation failed. + + + Removing Dedicated Circui Link + + + Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1} + + + Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'? + + + Removing Dedicated Circuit + + + Successfully removed Azure Dedicated Circuit with Service Key {0}. + + + Removing cloud service {0}... + + + Removing {0} deployment for {1} service + + + Removing job collection + + + Are you sure you want to remove the job collection "{0}" + + + Removing job + + + Are you sure you want to remove the job "{0}" + + + Are you sure you want to remove the account? + + + Account removed. + + + Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription. + + + Removing old package {0}... + + + Are you sure you want to delete the namespace '{0}'? + + + Are you sure you want to remove cloud service? + + + Remove cloud service and all it's deployments + + + Are you sure you want to remove subscription '{0}'? + + + Removing subscription + + + Are you sure you want to delete the VM '{0}'? + + + Deleting VM. + + + Removing WebJob... + + + Are you sure you want to remove job '{0}'? + + + Removing website + + + Are you sure you want to remove the website "{0}" + + + Deleting namespace + + + Repository is not setup. You need to pass a valid site name. + + + Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use. + + + Resource with ID : {0} does not exist. + WAPackIaaS + + + Restart + WAPackIaaS + + + Resume + WAPackIaaS + + + /role:{0};"{1}/{0}" + + + bin + + + Role {0} is {1} + + + 20 + + + role name + + + The provided role name {0} doesn't exist + + + RoleSettings.xml + + + Role type {0} doesn't exist + + + public static Dictionary<string, Location> ReverseLocations { get; private set; } + + + Preparing runtime deployment for service '{0}' + + + WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version? + + + RUNTIMEOVERRIDEURL + + + /runtimemanifest/runtimes/runtime + + + RUNTIMEID + + + RUNTIMEURL + + + RUNTIMEVERSIONPRIMARYKEY + + + scaffold.xml + + + Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation + + + A value for the Secondary Peer Subnet has to be provided. + + + Service {0} already exists on disk in location {1} + + + No ServiceBus authorization rule with the given characteristics was found + + + The service bus entity '{0}' is not found. + + + Internal Server Error. This could happen due to an incorrect/missing namespace + + + service configuration + + + service definition + + + ServiceDefinition.csdef + + + {0}Deploy + + + The specified cloud service "{0}" does not exist. + + + {0} slot for service {1} is in {2} state, please wait until it finish and update it's status + + + Begin Operation: {0} + + + Completed Operation: {0} + + + Begin Operation: {0} + + + Completed Operation: {0} + + + service name + + + Please provide name for the hosted service + + + service parent directory + + + Service {0} removed successfully + + + service directory + + + service settings + + + The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + + + The {0} slot for cloud service {1} doesn't exist. + + + {0} slot for service {1} is {2} + + + Set Add-On Confirmation + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at <url> and (c) agree to sharing my contact information with {2}. + + + Role {0} instances are set to {1} + + + {"Slot":"","Location":"","Subscription":"","StorageAccountName":""} + + + deploymentSettings.json + + + Confirm + + + Shutdown + WAPackIaaS + + + /sites:{0};{1};"{2}/{0}" + + + 1000 + + + Start + WAPackIaaS + + + Started + + + Starting Emulator... + + + start + + + Stop + WAPackIaaS + + + Stopping emulator... + + + Stopped + + + stop + + + Account Name: + + + Cannot find storage account '{0}' please type the name of an existing storage account. + + + AzureStorageEmulator.exe + + + InstallPath + + + SOFTWARE\Microsoft\Windows Azure Storage Emulator + + + Primary Key: + + + Secondary Key: + + + The subscription named {0} already exists. + + + DefaultSubscriptionData.xml + + + The subscription data file {0} does not exist. + + + Subscription must not be null + WAPackIaaS + + + Suspend + WAPackIaaS + + + Swapping website production slot ... + + + Are you sure you want to swap the website '{0}' production slot with slot '{1}'? + + + The provider {0} is unknown. + + + Update + WAPackIaaS + + + Updated settings for subscription '{0}'. Current subscription is '{1}'. + + + A value for the VLan Id has to be provided. + + + Please wait... + + + The azure storage emulator is not installed, skip launching... + + + Web.cloud.config + + + web.config + + + MSDeploy + + + Cannot build the project successfully. Please see logs in {0}. + + + WebRole + + + setup_web.cmd > log.txt + + + WebRole.xml + + + WebSite with given name {0} already exists in the specified Subscription and Webspace. + + + WebSite with given name {0} already exists in the specified Subscription and Location. + + + Site {0} already has repository created for it. + + + Workspaces/WebsiteExtension/Website/{0}/dashboard/ + + + https://{0}/msdeploy.axd?site={1} + + + WorkerRole + + + setup_worker.cmd > log.txt + + + WorkerRole.xml + + + Yes + + + Yes, I agree + + + Remove-AzureTrafficManagerProfile Operation failed. + + + Successfully removed Traffic Manager profile with name {0}. + + + Are you sure you want to remove the Traffic Manager profile "{0}"? + + + Profile {0} already has an endpoint with name {1} + + + Profile {0} does not contain endpoint {1}. Adding it. + + + The endpoint {0} cannot be removed from profile {1} because it's not in the profile. + + + Insufficient parameters passed to create a new endpoint. + + + Ambiguous operation: the profile name specified doesn't match the name of the profile object. + + + <NONE> + + + "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}." + {0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID. + + + Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}. + {0} is the string that is not in a valid base 64 format. + + + Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential". + + + Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'? + + + Removing environment + + + There is no subscription associated with account {0}. + + + Account id doesn't match one in subscription. + + + Environment name doesn't match one in subscription. + + + Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile? + + + Removing the Azure profile + + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + + + Account needs to be specified + + + No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription. + + + Path must specify a valid path to an Azure profile. + + + Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token} + + + Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'. + + + Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'. + + + Property bag Hashtable must contain a 'SubscriptionId'. + + + Selected profile must not be null. + + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + + + OperationID : '{0}' + + + Cannot get module for DscResource '{0}'. Possible solutions: +1) Specify -ModuleName for Import-DscResource in your configuration. +2) Unblock module that contains resource. +3) Move Import-DscResource inside Node block. + + 0 = name of DscResource + + + Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version. + {0} = minimal required PS version, {1} = current PS version + + + Parsing configuration script: {0} + {0} is the path to a script file + + + Configuration script '{0}' contained parse errors: +{1} + 0 = path to the configuration script, 1 = parser errors + + + List of required modules: [{0}]. + {0} = list of modules + + + Temp folder '{0}' created. + {0} = temp folder path + + + Copy '{0}' to '{1}'. + {0} = source, {1} = destination + + + Copy the module '{0}' to '{1}'. + {0} = source, {1} = destination + + + File '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the path to a file + + + Configuration file '{0}' not found. + 0 = path to the configuration file + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip). + 0 = path to the configuration file + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1). + 0 = path to the configuration file + + + Create Archive + + + Upload '{0}' + {0} is the name of an storage blob + + + Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the name of an storage blob + + + Configuration published to {0} + {0} is an URI + + + Deleted '{0}' + {0} is the path of a file + + + Cannot delete '{0}': {1} + {0} is the path of a file, {1} is an error message + + + Cannot find the WadCfg end element in the config. + + + WadCfg start element in the config is not matching the end element. + + + Cannot find the WadCfg element in the config. + + + Cannot find configuration data file: {0} + + + The configuration data must be a .psd1 file + + + Cannot change built-in environment {0}. + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. +Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable data collection: PS > Enable-AzDataCollection. + + + Microsoft Azure PowerShell Data Collection Confirmation + + + You choose not to participate in Microsoft Azure PowerShell data collection. + + + This confirmation message will be dismissed in '{0}' second(s)... + + + You choose to participate in Microsoft Azure PowerShell data collection. + + + The setting profile has been saved to the following path '{0}'. + + + [Common.Authentication]: Authenticating for account {0} with single tenant {1}. + + + Changing public environment is not supported. + + + Environment name needs to be specified. + + + Environment needs to be specified. + + + The environment name '{0}' is not found. + + + File path is not valid. + + + Must specify a non-null subscription name. + + + The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription. + + + Removing public environment is not supported. + + + The subscription id {0} doesn't exist. + + + Subscription name needs to be specified. + + + The subscription name {0} doesn't exist. + + + Subscription needs to be specified. + + + User name is not valid. + + + User name needs to be specified. + + + "There is no current context, please log in using Connect-AzAccount." + + + No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount? + + + No certificate was found in the certificate store with thumbprint {0} + + + Illegal characters in path. + + + Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings + + + "{0}" is an invalid DNS name for {1} + + + The provided file in {0} must be have {1} extension + + + {0} is invalid or empty + + + Please connect to internet before executing this cmdlet + + + Path {0} doesn't exist. + + + Path for {0} doesn't exist in {1}. + + + &whr={0} + + + The provided service name {0} already exists, please pick another name + + + Unable to update mismatching Json structured: {0} {1}. + + + (x86) + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. +Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enable-AzureDataCollection. + + + Execution failed because a background thread could not prompt the user. + + + Azure Long-Running Job + + + The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter. + 0(string): exception message in background task + + + Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts. + + + Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter. + + + Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again. + + + Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter. + + + [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}' + 0(bool): whether cmdlet confirmation is required + + + [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}' + 0(string): method type + + + [AzureLongRunningJob]: Completing cmdlet execution in RunJob + + + [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}' + 0(string): last state, 1(string): new state, 2(string): state change reason + + + [AzureLongRunningJob]: Unblocking job due to stoppage or failure + + + [AzureLongRunningJob]: Unblocking job that was previously blocked. + + + [AzureLongRunningJob]: Error in cmdlet execution + + + [AzureLongRunningJob]: Removing state changed event handler, exception '{0}' + 0(string): exception message + + + [AzureLongRunningJob]: ShouldMethod '{0}' unblocked. + 0(string): methodType + + + +- The parameter : '{0}' is changing. + + + +- The parameter : '{0}' is becoming mandatory. + + + +- The parameter : '{0}' is being replaced by parameter : '{1}'. + + + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + + +- Change description : {0} + + + The cmdlet is being deprecated. There will be no replacement for it. + + + The cmdlet parameter set is being deprecated. There will be no replacement for it. + + + The cmdlet '{0}' is replacing this cmdlet. + + + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' + + + +- The output type '{0}' is changing + + + +- The following properties are being added to the output type : + + + +- The following properties in the output type are being deprecated : + + + {0} + + + +- Cmdlet : '{0}' + - {1} + + + Upcoming breaking changes in the cmdlet '{0}' : + + + +- This change will take effect on '{0}' + + + +- The change is expected to take effect from the version : '{0}' + + + ```powershell +# Old +{0} + +# New +{1} +``` + + + + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} + + + +The output type '{0}' is being deprecated without a replacement. + + + +The type of the parameter is changing from '{0}' to '{1}'. + + + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + + This cmdlet is in preview. The functionality may not be available in the selected subscription. + + \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Response.cs b/swaggerci/datamigration/generated/runtime/Response.cs new file mode 100644 index 000000000000..9013c5ba7e87 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Response.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/datamigration/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..50ad83ad16e4 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/datamigration/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..3ab74b47e749 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/datamigration/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..cca59069d93e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Serialization/SerializationOptions.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/SerializationMode.cs b/swaggerci/datamigration/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..7d397d6028bc --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/TypeConverterExtensions.cs b/swaggerci/datamigration/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..7b3b4f59706e --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/TypeConverterExtensions.cs @@ -0,0 +1,211 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.PowerShell +{ + internal static class TypeConverterExtensions + { + internal static T[] SelectToArray(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0]; // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result.ToArray(); + } + + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Management.Automation.PSObject instance) + { + if (null != instance) + { + foreach (var each in instance.Properties) + { + yield return each; + } + } + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.Generic.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys.OfType() + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Management.Automation.PSObject instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + // new global::System.Collections.Generic.HashSet(System.StringComparer.InvariantCultureIgnoreCase) + return (null == instance || !instance.Properties.Any()) ? + Enumerable.Empty>() : + instance.Properties + .Where(property => + !(true == exclusions?.Contains(property.Name)) + && (false != inclusions?.Contains(property.Name))) + .Select(property => new System.Collections.Generic.KeyValuePair(property.Name, property.Value)); + } + + + internal static T GetValueForProperty(this System.Collections.Generic.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys, each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + internal static T GetValueForProperty(this System.Collections.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys.OfType(), each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static T GetValueForProperty(this System.Management.Automation.PSObject psObject, string propertyName, T defaultValue, System.Func converter) + { + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return property == null ? defaultValue : (T)converter(property.Value); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static bool Contains(this System.Management.Automation.PSObject psObject, string propertyName) + { + bool result = false; + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + result = property == null ? false : true; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return result; + } + } +} diff --git a/swaggerci/datamigration/generated/runtime/UndeclaredResponseException.cs b/swaggerci/datamigration/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..5af9c902a1c7 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/UndeclaredResponseException.cs @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/datamigration/generated/runtime/Writers/JsonWriter.cs b/swaggerci/datamigration/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..d9f5d8e091bb --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/datamigration/generated/runtime/delegates.cs b/swaggerci/datamigration/generated/runtime/delegates.cs new file mode 100644 index 000000000000..3fdfaf89ad32 --- /dev/null +++ b/swaggerci/datamigration/generated/runtime/delegates.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/datamigration/how-to.md b/swaggerci/datamigration/how-to.md new file mode 100644 index 000000000000..3dc1a7a13cbd --- /dev/null +++ b/swaggerci/datamigration/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.DataMigration`. + +## Building `Az.DataMigration` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.DataMigration` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.DataMigration` +To pack `Az.DataMigration` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.DataMigration`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.DataMigration.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.DataMigration.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.DataMigration`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.DataMigration` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/swaggerci/datamigration/internal/Az.DataMigration.internal.psm1 b/swaggerci/datamigration/internal/Az.DataMigration.internal.psm1 new file mode 100644 index 000000000000..53dd2d6b7670 --- /dev/null +++ b/swaggerci/datamigration/internal/Az.DataMigration.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.DataMigration.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Module]::Instance + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = $PSScriptRoot + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } +# endregion diff --git a/swaggerci/datamigration/internal/Get-AzDataMigrationOperation.ps1 b/swaggerci/datamigration/internal/Get-AzDataMigrationOperation.ps1 new file mode 100644 index 000000000000..a2e5adb1abd8 --- /dev/null +++ b/swaggerci/datamigration/internal/Get-AzDataMigrationOperation.ps1 @@ -0,0 +1,122 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists all of the available SQL Migration REST API operations. +.Description +Lists all of the available SQL Migration REST API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationoperation +#> +function Get-AzDataMigrationOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/datamigration/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/datamigration/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..a2e5adb1abd8 --- /dev/null +++ b/swaggerci/datamigration/internal/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,122 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists all of the available SQL Migration REST API operations. +.Description +Lists all of the available SQL Migration REST API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.datamigration/get-azdatamigrationoperation +#> +function Get-AzDataMigrationOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Models.Api20220330Preview.IOperationsDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.DataMigration.private\Get-AzDataMigrationOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/datamigration/internal/README.md b/swaggerci/datamigration/internal/README.md new file mode 100644 index 000000000000..57bec5123939 --- /dev/null +++ b/swaggerci/datamigration/internal/README.md @@ -0,0 +1,14 @@ +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.DataMigration.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.DataMigration`. Instead, this sub-module is imported by the `../custom/Az.DataMigration.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.DataMigration.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.DataMigration`. diff --git a/swaggerci/datamigration/license.txt b/swaggerci/datamigration/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/datamigration/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/swaggerci/datamigration/pack-module.ps1 b/swaggerci/datamigration/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/datamigration/pack-module.ps1 @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +Write-Host -ForegroundColor Green 'Packing module...' +dotnet pack $PSScriptRoot --no-build /nologo +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/datamigration/readme.md b/swaggerci/datamigration/readme.md new file mode 100644 index 000000000000..e4516f515588 --- /dev/null +++ b/swaggerci/datamigration/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/datamigration/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/datamigration/resource-manager/readme.powershell.md +``` diff --git a/swaggerci/datamigration/resources/README.md b/swaggerci/datamigration/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/datamigration/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/swaggerci/datamigration/run-module.ps1 b/swaggerci/datamigration/run-module.ps1 new file mode 100644 index 000000000000..04dc0db570b5 --- /dev/null +++ b/swaggerci/datamigration/run-module.ps1 @@ -0,0 +1,54 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Code) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$isAzure = $true +if($isAzure) { + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + # Load the latest version of Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.DataMigration.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +function Prompt { + Write-Host -NoNewline -ForegroundColor Green "PS $(Get-Location)" + Write-Host -NoNewline -ForegroundColor Gray ' [' + Write-Host -NoNewline -ForegroundColor White -BackgroundColor DarkCyan $moduleName + ']> ' +} + +# where we would find the launch.json file +$vscodeDirectory = New-Item -ItemType Directory -Force -Path (Join-Path $PSScriptRoot '.vscode') +$launchJson = Join-Path $vscodeDirectory 'launch.json' + +# if there is a launch.json file, let's just assume -Code, and update the file +if(($Code) -or (test-Path $launchJson) ) { + $launchContent = '{ "version": "0.2.0", "configurations":[{ "name":"Attach to PowerShell", "type":"coreclr", "request":"attach", "processId":"' + ([System.Diagnostics.Process]::GetCurrentProcess().Id) + '", "justMyCode":false }] }' + Set-Content -Path $launchJson -Value $launchContent + if($Code) { + # only launch vscode if they say -code + code $PSScriptRoot + } +} + +Import-Module -Name $modulePath \ No newline at end of file diff --git a/swaggerci/datamigration/test-module.ps1 b/swaggerci/datamigration/test-module.ps1 new file mode 100644 index 000000000000..77e7e125a2ee --- /dev/null +++ b/swaggerci/datamigration/test-module.ps1 @@ -0,0 +1,86 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) +{ + Write-Host -ForegroundColor Green 'Creating isolated process...' + if ($PSBoundParameters.ContainsKey("TestName")) { + $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," + } + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +# This is a workaround, since for string array parameter, pwsh -File will only take the first element +if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) { + $TestName = $TestName[0].Split(",") +} + +$ProgressPreference = 'SilentlyContinue' +$baseName = $PSScriptRoot.BaseName +$requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. ("$PSScriptRoot\test\utils.ps1") + +if ($requireResourceModule) +{ + # Load the latest Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version + $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1') + Import-Module -Name $resourceModulePSD.FullName +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) +{ + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.DataMigration.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +Import-Module -Name Pester +Import-Module -Name $modulePath + +$TestMode = 'playback' +$ExcludeTag = @("LiveOnly") +if($Live) +{ + $TestMode = 'live' + $ExcludeTag = @() +} +if($Record) +{ + $TestMode = 'record' +} +try +{ + if ($TestMode -ne 'playback') + { + setupEnv + } + $testFolder = Join-Path $PSScriptRoot 'test' + if ($null -ne $TestName) + { + Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } else + { + Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } +} Finally +{ + if ($TestMode -ne 'playback') + { + cleanupEnv + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 new file mode 100644 index 000000000000..3f2c32a706ba --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationDatabaseMigrationsSqlDb')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationDatabaseMigrationsSqlDb.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationDatabaseMigrationsSqlDb' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlMi.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlMi.Tests.ps1 new file mode 100644 index 000000000000..a2e0f948eec8 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlMi.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationDatabaseMigrationsSqlMi')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationDatabaseMigrationsSqlMi.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationDatabaseMigrationsSqlMi' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlVM.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlVM.Tests.ps1 new file mode 100644 index 000000000000..faf020296369 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationDatabaseMigrationsSqlVM.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationDatabaseMigrationsSqlVM')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationDatabaseMigrationsSqlVM.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationDatabaseMigrationsSqlVM' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationFile.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationFile.Tests.ps1 new file mode 100644 index 000000000000..ea580c501c95 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationFile.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationFile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationFile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationFile' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationProject.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationProject.Tests.ps1 new file mode 100644 index 000000000000..dd0352627984 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationProject.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationProject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationProject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationProject' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationResourceSku.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationResourceSku.Tests.ps1 new file mode 100644 index 000000000000..98bfdc437941 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationResourceSku.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationResourceSku')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationResourceSku.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationResourceSku' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationService.Tests.ps1 new file mode 100644 index 000000000000..2e9d5b36a7dc --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationService.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationService' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationServiceSku.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationServiceSku.Tests.ps1 new file mode 100644 index 000000000000..f0c48992146a --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationServiceSku.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationServiceSku')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationServiceSku.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationServiceSku' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationServiceTask.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationServiceTask.Tests.ps1 new file mode 100644 index 000000000000..5fdea9bdc165 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationServiceTask.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationServiceTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationServiceTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationServiceTask' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationService.Tests.ps1 new file mode 100644 index 000000000000..2a007a6be387 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationService.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationSqlMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationSqlMigrationService' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceAuthKey.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceAuthKey.Tests.ps1 new file mode 100644 index 000000000000..809acdba3af4 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceAuthKey.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationSqlMigrationServiceAuthKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlMigrationServiceAuthKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationSqlMigrationServiceAuthKey' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceMigration.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceMigration.Tests.ps1 new file mode 100644 index 000000000000..7d8560127b77 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceMigration.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationSqlMigrationServiceMigration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlMigrationServiceMigration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationSqlMigrationServiceMigration' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceMonitoringData.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceMonitoringData.Tests.ps1 new file mode 100644 index 000000000000..6bfda25e5128 --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationSqlMigrationServiceMonitoringData.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationSqlMigrationServiceMonitoringData')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationSqlMigrationServiceMonitoringData.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationSqlMigrationServiceMonitoringData' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationTask.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationTask.Tests.ps1 new file mode 100644 index 000000000000..47c5871580ca --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationTask.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationTask' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Get-AzDataMigrationUsage.Tests.ps1 b/swaggerci/datamigration/test/Get-AzDataMigrationUsage.Tests.ps1 new file mode 100644 index 000000000000..7099e5953e2c --- /dev/null +++ b/swaggerci/datamigration/test/Get-AzDataMigrationUsage.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataMigrationUsage')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataMigrationUsage.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzDataMigrationUsage' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Invoke-AzDataMigrationCommandTask.Tests.ps1 b/swaggerci/datamigration/test/Invoke-AzDataMigrationCommandTask.Tests.ps1 new file mode 100644 index 000000000000..fea104b6c4cd --- /dev/null +++ b/swaggerci/datamigration/test/Invoke-AzDataMigrationCommandTask.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzDataMigrationCommandTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzDataMigrationCommandTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzDataMigrationCommandTask' { + It 'CommandExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Command' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CommandViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CommandViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.Tests.ps1 b/swaggerci/datamigration/test/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.Tests.ps1 new file mode 100644 index 000000000000..a52543de268a --- /dev/null +++ b/swaggerci/datamigration/test/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlMi' { + It 'CutoverExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Cutover' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CutoverViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CutoverViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.Tests.ps1 b/swaggerci/datamigration/test/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.Tests.ps1 new file mode 100644 index 000000000000..3288be2b0000 --- /dev/null +++ b/swaggerci/datamigration/test/Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzDataMigrationCutoverDatabaseMigrationSqlVM' { + It 'CutoverExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Cutover' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CutoverViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CutoverViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlDb.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlDb.Tests.ps1 new file mode 100644 index 000000000000..ea3b20ae249b --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlDb.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationDatabaseMigrationSqlDb')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationDatabaseMigrationSqlDb.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationDatabaseMigrationSqlDb' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlMi.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlMi.Tests.ps1 new file mode 100644 index 000000000000..deef07c135ca --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlMi.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationDatabaseMigrationSqlMi')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationDatabaseMigrationSqlMi.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationDatabaseMigrationSqlMi' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlVM.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlVM.Tests.ps1 new file mode 100644 index 000000000000..38112b96a4ab --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationDatabaseMigrationSqlVM.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationDatabaseMigrationSqlVM')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationDatabaseMigrationSqlVM.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationDatabaseMigrationSqlVM' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationFile.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationFile.Tests.ps1 new file mode 100644 index 000000000000..3076ac830202 --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationFile.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationFile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationFile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationFile' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationProject.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationProject.Tests.ps1 new file mode 100644 index 000000000000..9e59e01a8e8c --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationProject.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationProject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationProject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationProject' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationService.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationService.Tests.ps1 new file mode 100644 index 000000000000..b199a8594330 --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationService.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationService' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationServiceTask.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationServiceTask.Tests.ps1 new file mode 100644 index 000000000000..a138771a3c40 --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationServiceTask.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationServiceTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationServiceTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationServiceTask' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationSqlMigrationService.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationSqlMigrationService.Tests.ps1 new file mode 100644 index 000000000000..a8abf1dc9ac5 --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationSqlMigrationService.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationSqlMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationSqlMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationSqlMigrationService' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationSqlMigrationServiceAuthKey.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationSqlMigrationServiceAuthKey.Tests.ps1 new file mode 100644 index 000000000000..5a5ed5878604 --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationSqlMigrationServiceAuthKey.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationSqlMigrationServiceAuthKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationSqlMigrationServiceAuthKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationSqlMigrationServiceAuthKey' { + It 'RegenerateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Regenerate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/New-AzDataMigrationTask.Tests.ps1 b/swaggerci/datamigration/test/New-AzDataMigrationTask.Tests.ps1 new file mode 100644 index 000000000000..58ca0dbcfc26 --- /dev/null +++ b/swaggerci/datamigration/test/New-AzDataMigrationTask.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataMigrationTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataMigrationTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzDataMigrationTask' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/README.md b/swaggerci/datamigration/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/datamigration/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/swaggerci/datamigration/test/Read-AzDataMigrationFile.Tests.ps1 b/swaggerci/datamigration/test/Read-AzDataMigrationFile.Tests.ps1 new file mode 100644 index 000000000000..aef7dbb4156c --- /dev/null +++ b/swaggerci/datamigration/test/Read-AzDataMigrationFile.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Read-AzDataMigrationFile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Read-AzDataMigrationFile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Read-AzDataMigrationFile' { + It 'Read' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ReadViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Read-AzDataMigrationFileWrite.Tests.ps1 b/swaggerci/datamigration/test/Read-AzDataMigrationFileWrite.Tests.ps1 new file mode 100644 index 000000000000..2d9ba41f74db --- /dev/null +++ b/swaggerci/datamigration/test/Read-AzDataMigrationFileWrite.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Read-AzDataMigrationFileWrite')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Read-AzDataMigrationFileWrite.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Read-AzDataMigrationFileWrite' { + It 'Read' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ReadViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 new file mode 100644 index 000000000000..7a50c7035562 --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationDatabaseMigrationsSqlDb')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationDatabaseMigrationsSqlDb.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationDatabaseMigrationsSqlDb' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationFile.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationFile.Tests.ps1 new file mode 100644 index 000000000000..2bb1e43574fa --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationFile.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationFile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationFile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationFile' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationProject.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationProject.Tests.ps1 new file mode 100644 index 000000000000..2ab3e7f10fbb --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationProject.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationProject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationProject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationProject' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationService.Tests.ps1 new file mode 100644 index 000000000000..b6c93add9b3c --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationService.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationService' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationServiceTask.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationServiceTask.Tests.ps1 new file mode 100644 index 000000000000..e551119e3c30 --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationServiceTask.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationServiceTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationServiceTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationServiceTask' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationSqlMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationSqlMigrationService.Tests.ps1 new file mode 100644 index 000000000000..2276b5f4cebf --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationSqlMigrationService.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationSqlMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationSqlMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationSqlMigrationService' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationSqlMigrationServiceNode.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationSqlMigrationServiceNode.Tests.ps1 new file mode 100644 index 000000000000..39a9e9c5255b --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationSqlMigrationServiceNode.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationSqlMigrationServiceNode')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationSqlMigrationServiceNode.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationSqlMigrationServiceNode' { + It 'DeleteExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Remove-AzDataMigrationTask.Tests.ps1 b/swaggerci/datamigration/test/Remove-AzDataMigrationTask.Tests.ps1 new file mode 100644 index 000000000000..27f044e9eb18 --- /dev/null +++ b/swaggerci/datamigration/test/Remove-AzDataMigrationTask.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataMigrationTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataMigrationTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzDataMigrationTask' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Start-AzDataMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Start-AzDataMigrationService.Tests.ps1 new file mode 100644 index 000000000000..21027a84e172 --- /dev/null +++ b/swaggerci/datamigration/test/Start-AzDataMigrationService.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Start-AzDataMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Start-AzDataMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Start-AzDataMigrationService' { + It 'Start' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'StartViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 b/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 new file mode 100644 index 000000000000..cb09eafd6259 --- /dev/null +++ b/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlDb.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Stop-AzDataMigrationDatabaseMigrationsSqlDb')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Stop-AzDataMigrationDatabaseMigrationsSqlDb.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Stop-AzDataMigrationDatabaseMigrationsSqlDb' { + It 'CancelExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Cancel' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlMi.Tests.ps1 b/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlMi.Tests.ps1 new file mode 100644 index 000000000000..cce9722d1de3 --- /dev/null +++ b/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlMi.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Stop-AzDataMigrationDatabaseMigrationsSqlMi')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Stop-AzDataMigrationDatabaseMigrationsSqlMi.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Stop-AzDataMigrationDatabaseMigrationsSqlMi' { + It 'CancelExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Cancel' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlVM.Tests.ps1 b/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlVM.Tests.ps1 new file mode 100644 index 000000000000..60f4cfbc9a00 --- /dev/null +++ b/swaggerci/datamigration/test/Stop-AzDataMigrationDatabaseMigrationsSqlVM.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Stop-AzDataMigrationDatabaseMigrationsSqlVM')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Stop-AzDataMigrationDatabaseMigrationsSqlVM.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Stop-AzDataMigrationDatabaseMigrationsSqlVM' { + It 'CancelExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Cancel' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Stop-AzDataMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Stop-AzDataMigrationService.Tests.ps1 new file mode 100644 index 000000000000..f1ee25d46aaa --- /dev/null +++ b/swaggerci/datamigration/test/Stop-AzDataMigrationService.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Stop-AzDataMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Stop-AzDataMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Stop-AzDataMigrationService' { + It 'Stop' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'StopViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Stop-AzDataMigrationServiceTask.Tests.ps1 b/swaggerci/datamigration/test/Stop-AzDataMigrationServiceTask.Tests.ps1 new file mode 100644 index 000000000000..28c8e6932962 --- /dev/null +++ b/swaggerci/datamigration/test/Stop-AzDataMigrationServiceTask.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Stop-AzDataMigrationServiceTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Stop-AzDataMigrationServiceTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Stop-AzDataMigrationServiceTask' { + It 'Cancel' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Stop-AzDataMigrationTask.Tests.ps1 b/swaggerci/datamigration/test/Stop-AzDataMigrationTask.Tests.ps1 new file mode 100644 index 000000000000..26cee30799f3 --- /dev/null +++ b/swaggerci/datamigration/test/Stop-AzDataMigrationTask.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Stop-AzDataMigrationTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Stop-AzDataMigrationTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Stop-AzDataMigrationTask' { + It 'Cancel' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CancelViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Test-AzDataMigrationServiceChildNameAvailability.Tests.ps1 b/swaggerci/datamigration/test/Test-AzDataMigrationServiceChildNameAvailability.Tests.ps1 new file mode 100644 index 000000000000..33501e93b74a --- /dev/null +++ b/swaggerci/datamigration/test/Test-AzDataMigrationServiceChildNameAvailability.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Test-AzDataMigrationServiceChildNameAvailability')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Test-AzDataMigrationServiceChildNameAvailability.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Test-AzDataMigrationServiceChildNameAvailability' { + It 'CheckExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Check' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Test-AzDataMigrationServiceNameAvailability.Tests.ps1 b/swaggerci/datamigration/test/Test-AzDataMigrationServiceNameAvailability.Tests.ps1 new file mode 100644 index 000000000000..e90d80636e12 --- /dev/null +++ b/swaggerci/datamigration/test/Test-AzDataMigrationServiceNameAvailability.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Test-AzDataMigrationServiceNameAvailability')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Test-AzDataMigrationServiceNameAvailability.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Test-AzDataMigrationServiceNameAvailability' { + It 'CheckExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Check' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Test-AzDataMigrationServiceStatus.Tests.ps1 b/swaggerci/datamigration/test/Test-AzDataMigrationServiceStatus.Tests.ps1 new file mode 100644 index 000000000000..01e5fa395a15 --- /dev/null +++ b/swaggerci/datamigration/test/Test-AzDataMigrationServiceStatus.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Test-AzDataMigrationServiceStatus')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Test-AzDataMigrationServiceStatus.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Test-AzDataMigrationServiceStatus' { + It 'Check' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Update-AzDataMigrationFile.Tests.ps1 b/swaggerci/datamigration/test/Update-AzDataMigrationFile.Tests.ps1 new file mode 100644 index 000000000000..68e2c716acd8 --- /dev/null +++ b/swaggerci/datamigration/test/Update-AzDataMigrationFile.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataMigrationFile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataMigrationFile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzDataMigrationFile' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Update-AzDataMigrationProject.Tests.ps1 b/swaggerci/datamigration/test/Update-AzDataMigrationProject.Tests.ps1 new file mode 100644 index 000000000000..cf8973d45be6 --- /dev/null +++ b/swaggerci/datamigration/test/Update-AzDataMigrationProject.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataMigrationProject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataMigrationProject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzDataMigrationProject' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Update-AzDataMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Update-AzDataMigrationService.Tests.ps1 new file mode 100644 index 000000000000..46c697b772ae --- /dev/null +++ b/swaggerci/datamigration/test/Update-AzDataMigrationService.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzDataMigrationService' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Update-AzDataMigrationServiceTask.Tests.ps1 b/swaggerci/datamigration/test/Update-AzDataMigrationServiceTask.Tests.ps1 new file mode 100644 index 000000000000..55d3c1aee8ca --- /dev/null +++ b/swaggerci/datamigration/test/Update-AzDataMigrationServiceTask.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataMigrationServiceTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataMigrationServiceTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzDataMigrationServiceTask' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Update-AzDataMigrationSqlMigrationService.Tests.ps1 b/swaggerci/datamigration/test/Update-AzDataMigrationSqlMigrationService.Tests.ps1 new file mode 100644 index 000000000000..2d507e7d0880 --- /dev/null +++ b/swaggerci/datamigration/test/Update-AzDataMigrationSqlMigrationService.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataMigrationSqlMigrationService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataMigrationSqlMigrationService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzDataMigrationSqlMigrationService' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/Update-AzDataMigrationTask.Tests.ps1 b/swaggerci/datamigration/test/Update-AzDataMigrationTask.Tests.ps1 new file mode 100644 index 000000000000..024dcea79407 --- /dev/null +++ b/swaggerci/datamigration/test/Update-AzDataMigrationTask.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataMigrationTask')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataMigrationTask.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzDataMigrationTask' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/datamigration/test/loadEnv.ps1 b/swaggerci/datamigration/test/loadEnv.ps1 new file mode 100644 index 000000000000..0ea394729062 --- /dev/null +++ b/swaggerci/datamigration/test/loadEnv.ps1 @@ -0,0 +1,21 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/datamigration/test/utils.ps1 b/swaggerci/datamigration/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/datamigration/test/utils.ps1 @@ -0,0 +1,31 @@ +function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/swaggerci/datamigration/utils/Unprotect-SecureString.ps1 b/swaggerci/datamigration/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/datamigration/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file